1

I'm setting up a development environment for SP2019.

I've installed as per the development stack recommended within the guidance material and roadmap page for SPFx 1.12.1 https://docs.microsoft.com/en-us/sharepoint/dev/spfx/release-1.12.1

  • Node.js 14.15.0
  • gulp CLI 2.3.0 and Local 4.0.2
  • yeoman 4.3.0
  • @microsoft/generator-sharepoint 1.12.1

Once I've started my new project by running,

yo @microsoft/sharepoint

And come to trusting the dev certificate by running

gulp trust-dev-cert

followed by

npm install
gulp serve

I'm getting an error that is causing gulp serve to fail.

Build target: DEBUG
[13:11:48] Using gulpfile U:\SPFx\gulpfile.js
[13:11:48] Starting 'serve'...
[13:11:49] Starting gulp
[13:11:49] Starting subtask 'configure-sp-build-rig'...
[13:11:50] Finished subtask 'configure-sp-build-rig' after 475 ms
[13:11:50] Starting subtask 'spfx-serve'...
Starting api server on port 5432.
Registring api: /getwebparts
Registring api: /*.*
Registring api: /workbench
[13:14:02] Error - [spfx-serve] Error: Invalid glob argument:
[13:14:02] Error - 'spfx-serve' sub task errored after 2.18 min
 Invalid glob argument:
[13:14:02] 'serve' errored after 2.22 min
[13:14:02]
About to exit with code: 1
Process terminated before summary could be written, possible error in async code not continuing!
Trying to exit with exit code 1

Common advice on this board to resolve that error is to downgrade to gulp 3.9.1.

I can't do that for two reasons, I experience another error caused by my gulp version being less than 4. gulp trust-dev-cert gives the error: ReferenceError: primordials is not defined

I also need according to the roadmap page gulp v4 to be part of the stack to support SPFx 1.12.1 to develop for SharePoint 2019 and above.

How do I resolve this, I seem to be stuck between a rock and a hard place.

1

SharePoint Server 2019 supports SharePoint Framework client-side web parts hosted on classic or modern SharePoint pages built by using the SharePoint Framework v1.4.1.

SharePoint Server 2019 also supports SharePoint Framework extensions hosted on modern SharePoint pages built using SharePoint Framework v1.4.1. This means that when you're targeting the SharePoint Server 2019 platform, you need to use the SharePoint Framework v1.4.1 because of the server-side version dependencies.

Source - Microsoft Docs: SP 2019 - Which version of the SharePoint Framework to use


Also check the SPFx version compatibility matrix at: SharePoint Framework development tools and libraries compatibility

6
  • So. The full stack I have. To generate a 'Hello World' webpart;
    – Sideburnt
    Oct 18 '21 at 8:39
  • You have to use v1.4.1 & you can check SPFx version compatibility matrix for supported node/gulp/yo versions. Oct 18 '21 at 9:26
  • So, going backwards. If I need to generate a simple 'Hello World' app to test with on SharePoint Online using (Globally); +-- @microsoft/generator-sharepoint@1.12.1 +-- gulp-cli@2.3.0 +-- npm@7.24.2 +-- tls-test@1.0.0 `-- yo@4.3.0
    – Sideburnt
    Oct 19 '21 at 12:57
  • then Locally +-- @microsoft/rush-stack-compiler-3.7@0.6.47 +-- @microsoft/sp-build-web@1.4.1 +-- @microsoft/sp-core-library@1.4.1 +-- @microsoft/sp-lodash-subset@1.4.1 +-- @microsoft/sp-module-interfaces@1.4.1 +-- @microsoft/sp-office-ui-fabric-core@1.4.1 +-- @microsoft/sp-webpart-base@1.4.1 +-- @microsoft/sp-webpart-workbench@1.4.1 +-- @types/webpack-env@1.13.1 +-- ajv@5.2.5 `-- gulp@4.0.2
    – Sideburnt
    Oct 19 '21 at 12:57
  • Yes. You can also use nvm to install & use multiple versions of node js on single system. Oct 21 '21 at 11:05

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.