Questions tagged [spfx]

The SharePoint Framework (SPFx) is a page and web part model that provides full support for client-side SharePoint development, easy integration with SharePoint data, and support for open source tooling.

975 questions
13
votes
4 answers

yo @microsoft/sharepoint fails on TypeError: lookups.flatMap is not a function

After installation of Node v10.16.1 and installation of gulp and yo (Everything looks alright !) it fails on command yo @microsoft/sharepoint with TypeError: lookups.flatMap is not a…
thb
  • 167
  • 1
  • 1
  • 7
11
votes
5 answers

How can I get the siteId of the current site with Microsoft Graph API?

From the documentation, I can't find any ways to get the siteId of the site where I put the webpart in. For example, My current site is: https://{hostname}/sites/main1 <-- NOT root site, but I want to get this siteId and I test my webpart here:…
PCHC
  • 177
  • 1
  • 2
  • 9
7
votes
1 answer

Type 'Promise' is not assignable to type 'MouseEventHandler

I'm trying to build an spfx webpart that updates a list in the same context, the button triggers a function that get the the current user name from the context along with a date, builds a json and then stringifies it, then I build a graph request…
Sahar Barak
  • 71
  • 1
  • 2
7
votes
1 answer

How to re-render react component when a property changes

so I have this react component, with a dropdown property (SPFx) which has 2 values, I need that when the dropdown is changed the react is re-rendered again, the dropdown defines the datasource from where the values will be…
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
7
votes
0 answers

Microsoft Teams - downloading a file from within a tab

I've created a configurable tab app and have side-loaded it into Teams. On the content page, I want to allow the user to download a file. Simply linking to the file doesn't work. When the user clicks the link, the content iframe redirects and goes…
Derek Smith
  • 853
  • 1
  • 7
  • 14
7
votes
4 answers

How to force Office UI Fabric ChoiceGroup to align horizontal

I am trying to build a SPFx webpart containing a ChoiceGroup. When I set the css style to ms-sm12 the choices are aligned vertical: Show assigned to: o anyone * me o nobody I like them to align horizontal in one row: Show assigned to: o anyone * me…
Dennis Kuhn
  • 239
  • 3
  • 10
4
votes
2 answers

Uncaught TypeError: Cannot read property 'sid' of undefined socket.io.client

I am using socket.io.client in a spfx react app and getting this error while doing the socket connection: Uncaught TypeError: Cannot read property 'sid' of undefined
4
votes
2 answers

How to get the current theme in a spfx webpart using the new ts based styling approach

We are developing modern webparts for O365 Communication Sites using Office UI Fabric React. I want to use the new ts-based approach to styling my components(see here). Everything works quite well, except that it's not using the current theme of…
dominikk
  • 356
  • 3
  • 11
4
votes
3 answers

How to set ErrorMessage on TextField dynamically on Button onClick method

I need to bind ErrorMessage to textfield only when user press button. In this there are nice examples how to use errormessage but the problem is that I don't know how to make append errorMeesage after user click
user1223484
  • 175
  • 2
  • 12
4
votes
1 answer

SPFx Webpart - node_modules/@types/ [prop types] and [react] index.d.ts: loads of "error TS1005" on gulp build

So Im building a spfx webpart of which one feature is to display link previews. I used this library for the task. I had to change the version of the package "styled-components" and update my "react"(16.4.18) and "react-dom"(16.0.9) in order for it…
4
votes
1 answer

MS Fabric DetailList with input box tabIndex always renders to -1

I am adding a input box to a column in a Microsoft Fabric DeatialsList. I set it in the onRender of the IColumn definition. All works fine except the tabIndex is alway -1. I would like to set it to 0. export default class Scrach extends…
Mark
  • 803
  • 3
  • 11
  • 21
3
votes
0 answers

How to connect to dataverse rest api from sharepoint online webpart

It seems to be hard finding a good sample or article on this and i was hoping to get some links to samples or articles with regards to configuring this. Or if someone has some experience connecting to dataverse from spfx webparts? caveats and…
Ole Bergtun
  • 113
  • 6
3
votes
1 answer

Yo @microsoft/sharepoint generator Cannot find "package.json" file required by this generator

I just reset my development environment and installed node and npm via nvm. Also installed yeoman and downloaded the @microsoft/sharepoint generator. When I go to run the yo @microsoft/sharepoint I get to to the point where I name my extension and…
Jono Suave
  • 101
  • 1
  • 5
3
votes
0 answers

SharePoint Online throws error when trying to get thumbnail for video file using '/_layouts/15/getpreview.ashx?path='

I am using SharePoint endpoint to get document preview for document. I am able to retrieve preview for document. but, facing issue with video files as it throws below error: This site can’t be reachedThe webpage at…
3
votes
2 answers

Getting issue while implementing FluentUI using SPFx in SharePoint online

I am following this blog to implement the fluentUI in SPFX part, but while doing "Gulp Build" I'm getting the following error: Error - [tsc] node_modules/@fluentui/react/lib/components/GroupedList/GroupedListSection.d.ts(9,38): error TS1005: ';'…
Kailash Sahoo
  • 139
  • 1
  • 5
1
2 3
64 65