1

I am trying to setup SP2016 onprem with React, using Yoeman generator @microsoft/sharepoint.

I am getting errors when I run gulp serve.

Need Help on setting up this project using SPFX.

I have raised a github issue as well, kindly check it for more info : Link

Kindly, please share latest steps to be used for setting up SP2016 onprem with React.

* UPDATE * Error being generated :

Error - typescript - src\webparts\helloWorld\HelloWorldWebPart.ts(7,7): error TS2307: Cannot find module '@microsoft/sp-property-pane'. Error - 'typescript' sub task errored after 6.45 s "TypeScript error(s) occurred."

  • Looks like there is regression in the new release. Can you reinstall the generator using npm install -g @microsoft/generator-sharepoint@1.7.1 and then create a webpart for 2016 and check ? – Gautam Sheth Mar 18 at 10:48
  • I started with 1.7.1 version only. Even that was not working for me – JEEVAN GEORGE ANTONY Mar 18 at 11:27
  • Quite strange, can you try with npm install -g @microsoft/generator-sharepoint@1.6.0 and check ? – Gautam Sheth Mar 18 at 11:33
  • will try that one. – JEEVAN GEORGE ANTONY Mar 18 at 11:36
  • @GautamSheth , i tried with V1.6.0 generator. There were no errors, but the site was not loading with just gulp serve. But with following command, set NODE_NO_HTTP2=1 && gulp serve , I was able to load the site. – JEEVAN GEORGE ANTONY Mar 18 at 13:52
0

Based on @Gautam Sheth 's comment,

I implemented following steps and was able to load SP2016 onprem using react Site without any errors, :

  • npm list -g --depth 0
  • npm uninstall -g @microsoft/generator-sharepoint
  • npm install -g @microsoft/generator-sharepoint@1.6.0
  • yo @microsoft/sharepoint --skip-install
  • gave answers to the prompts for SP2016 onprem with react using spfx
  • npm i
  • made a change for following warning : Warning - tslint - src\webparts\helloWorld\components\HelloWorld.tsx(16,23): error quotemark: " should be '
  • set NODE_NO_HTTP2=1 && gulp serve

Works for V1.7.0 (@microsoft/generator-sharepoint) of the yoeman generator as well.

For V1.7.1 and V1.8.0, @microsoft/generator-sharepoint , were not generating error free SP2016 onprem with React solution. Support for this on the latest versions would be appreciated greatly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.