0

I am trying to setup a SharePoint 2016 on-premise site with react using Yeoman generator : @microsoft/generator-sharepoint (V1.7.1).

I followed the instructions from microsoft docs only. I had referred few other resources as well for changing package modules and getting a working solution. Some of the resources are:

  1. SharePoint Framework v1.7.0 - What's in the latest update of SPFx
  2. some other resources which suggested to use: npm outdated command to check and confirm that required versions are installed.

Steps I followed :

  1. Downgraded my Node from 10.x to 8.15.1 .Reason : 9.x or 10.x Node versions are currently not supported with SharePoint Framework development.
  2. Install Yeoman and gulp ==> npm install -g yo gulp
  3. Install Yeoman SharePoint generator ==> npm install -g @microsoft/generator-sharepoint .
  4. Creating a new web part project ==> yo @microsoft/sharepoint --skip-install
  5. After solution got created,updated package.json to following :

    { "name": "sample", "version": "0.0.1", "private": true, "engines": { "node": ">=0.10.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "react": "16.3.2", "react-dom": "16.3.2", "@types/react": "16.4.2", "@types/react-dom": "16.0.5", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-update": "0.14.14", "@types/react-addons-test-utils": "0.14.15", "@microsoft/sp-core-library": "~1.7.1", "@microsoft/sp-webpart-base": "~1.7.1", "@microsoft/sp-lodash-subset": "~1.7.1", "@microsoft/sp-office-ui-fabric-core": "~1.7.1", "@types/webpack-env": "1.13.1", "@types/es6-promise": "0.0.33" }, "resolutions": { "@types/react": "16.4.2" }, "devDependencies": { "@microsoft/sp-build-web": "~1.7.1", "@microsoft/sp-module-interfaces": "~1.7.1", "@microsoft/sp-webpart-workbench": "~1.7.1", "gulp": "~3.9.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38", "ajv": "~5.2.2" } }

  6. Then run ==> npm i --save ==> Ignored warnings generated along with it.
  7. After installation, run ==> gulp trust-dev-cert
  8. Finally, run ==> gulp serve.

After following these sequence of steps, SPFX site got loaded in the localhost at port 4321. But in every 5 to 10 seconds it is getting reloaded continuously in chrome and IE as well.

Need help in fixing this.

Hope I haven't missed anything so far for the SPFX Project setup.

1 Answers1

1

If I understand your question correctly you are trying to run SPFx 1.7.1 with React 16 on an On Premise SharePoint 2016 farm? This won't work. SharePoint 2016 does not have the laatste SPFx available. You will need to downgrade your project to match the version of SPFx shipped with SharePoint on premise:

SharePoint 2016 Feature Pack 2 supports SharePoint Framework client-side web parts hosted on classic SharePoint pages built by using the SharePoint Framework v1.1.0. This means that when you are targeting the SharePoint 2016 platform, you need to use the SharePoint Framework v1.1.0 due to the server-side version dependencies.

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-2016-support

SharePoint 2019 on premise is currently shipped with SPFx 1.4.1. I can't find a docs link for this atm, but it has been mentioned in community calls by Microsoft folks.

Judith
  • 74
  • 7
  • But , with default package.json being generated upon selection for SP2016 onprem, site is not even loading. It would be great, if someone could share steps for setting up SP2016 onprem project using SPFX with react. – JEEVAN GEORGE ANTONY Mar 18 '19 at 05:12
  • Have you watched the video on the page I linked? It has a full step by step guide for an OnPrem project. https://www.youtube.com/watch?v=LGLMxnmHk6U&feature=youtu.be&list=PLR9nK3mnD-OXZbEvTEPxzIOMGXj_aZKJG – Judith Mar 19 '19 at 10:13
  • Yes, But the version that was demoing over there was for older version. – JEEVAN GEORGE ANTONY Mar 19 '19 at 13:45