Hot answers tagged

7 votes
Accepted

Property 'web' does not exist on type 'SPRest'

In the previous versions 'web' was still present in the rest.d.ts file of the @pnp/sp package. That's not the case anymore. In your main webpart TypeScript file, you have to use the import as follow: ...
user avatar
  • 86
5 votes
Accepted

Updating SPFX breaks gulp

In 1.6.0 projects the config/tslint.json file was removed and a new one is created at the root of the solution. Delete E:\DevEnv\WebParts\react-full-iframe\config\tslint.json. You should also add the ...
user avatar
  • 555
3 votes

Sharepoint framework (spfx) failes to create new project

Try to reinstall node js version 8.* https://nodejs.org/dist/latest-v8.x/ It is officaly supported version by Microsoft. Then try to run yo generator without the parameters. Only yo @microsoft/...
user avatar
  • 163
3 votes

Share "node_modules" folder between webparts

Instead of creating a different projects for the webparts, please create all the webparts in a single SPFx solution. These webparts will share the common node_modules folder of the SPFx solution. ...
user avatar
  • 1,340
2 votes

Local gulp not found when executing gulp serve

Hi here you go this should work, after you run bellow command: Step-1: npm install @microsoft/generator-sharepoint --save-dev you should run the following command: Step-2: yo @microsoft/...
user avatar
  • 1,019
2 votes

Share "node_modules" folder between webparts

This is standard behaviour and the best approach for various reasons. Each project (which can include 1 or more webparts) needs to have a node_modules folder. This ensures that who ever builds your ...
user avatar
2 votes

SPFx Yeoman generates wrong package versions

Fixed by running: npm cache clear --force
user avatar
  • 33
2 votes
Accepted

SPFx development - npm audit vulnerabilities

With SPFx solutions, none of the npm packages are deployed to SharePoint, so you can ignore these audit warnings. If you had a custom solution that did deploy the npm packages themselves, yes you'd ...
user avatar
  • 28.9k
2 votes

"gulp serve --nobrowser" is raising this error "Task never defined: serve"

It sounds like your system may not be properly configured. The first step is to check to see which version of SPFx you have installed. You can do this by running npm list -g --depth=1 @microsoft/...
user avatar
  • 11.5k
1 vote
Accepted

gulp build is raising this Error - [tslint] Error: Cannot find module '@microsoft/rush-stack-compiler-3.2'

This is a computability issue. SharePoint Framework (SPFx) 1.7.1 requires the following node.js LTS 8.x npm v5, v6 yeoman yo@3.1.1. (for creating new projects only) This is what you have. It won't ...
user avatar
1 vote
Accepted

ts Cannot find the module

It looks like it is bug in visual studio code or may be in yomean or may be in typescript because when I run gulp serve it compile web part and resolve the issue by it self. Hope this can help ...
user avatar
  • 1,519
1 vote

Property 'web' does not exist on type 'SPRest'

In IReactSpfxProps.ts file: import { WebPartContext } from "@microsoft/sp-webpart-base"; export interface IReactSpfxProps { description: string; context: WebPartContext; } ...
user avatar
  • 2,493
1 vote

How to fix error cannot find module @microsoft/sp-build-web.When trying the sp-dev-ebpart samples

@microsoft/sp-build-web should be installed when you run npm install the first time. In package.json, this is referenced in the devDependencies section: "devDependencies": { "@microsoft/sp-build-...
user avatar
  • 2,229
1 vote

Got the error in SPFx installation "Yeoman Doctor - Running sanity checks on your system"

Have you added C:\Program Files\nodejs to your PATH environment variable ? Follow the steps below :- Search for the Environment Variables Once you locate them Click on Edit Environment Variables. ...
user avatar
  • 1,103
1 vote

Local gulp not found when executing gulp serve

Try running npm install --save-dev gulp instead of npm install --save-dev gulp-install
user avatar
1 vote
Accepted

SharePoint 2016 On Premise Dev using SharePoint Framework

Install SharePoint Feature Pack 2 from here: security update for SharePoint Server 2016: September 12, 2017 This update allows SPFX Development in SharePoint 2016 on-premise.
user avatar
  • 2,493
1 vote
Accepted

pnp.sp.site.getWebUrlFromPageUrl method is returning wrong web URL

Not really sure why GetWebUrlFromPageUrl is not working. But as you mentioned in the comment that you want the current sp web url, you can use the this.context.pageContext object. No need to make a ...
user avatar
  • 30.3k

Only top scored, non community-wiki answers of a minimum length are eligible