pnp / sp-dev-fx-webparts

SharePoint Framework web part, Teams tab, personal app, app page samples
http://aka.ms/spfx-webparts
MIT License
2.03k stars 3.84k forks source link

Unable to Gulp Build React-Birthday #2216

Closed hilmarj1 closed 2 years ago

hilmarj1 commented 2 years ago

Sample

https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-birthdays

Author(s)

@João Mendes

What happened?

I am a total noob when it comes to web parts but I have been able to build a few and use them, but when I try to build it I always get this graph error.

PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays> npm install

removed 1 package, changed 2 packages, and audited 2737 packages in 34s

118 packages are looking for funding run npm fund for details

137 vulnerabilities (6 low, 97 moderate, 31 high, 3 critical)

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays> gulp build Build target: DEBUG [10:05:00] Using gulpfile C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays\gulpfile.js [10:05:00] Starting 'build'... [10:05:00] Starting gulp [10:05:00] Starting subtask 'pre-copy'... [10:05:00] Finished subtask 'pre-copy' after 130 ms [10:05:00] Starting subtask 'copy-static-assets'... [10:05:00] Starting subtask 'sass'... [10:05:01] Finished subtask 'sass' after 1.57 s [10:05:01] Starting subtask 'tslint'... [10:05:02] [tslint] tslint version: 5.20.1 [10:05:03] Starting subtask 'tsc'... [10:05:03] [tsc] typescript version: 3.2.4 [10:05:04] Finished subtask 'copy-static-assets' after 3.71 s [10:05:11] Finished subtask 'tslint' after 9.91 s [10:05:12] Error - [tsc] src/services/SPService.ts(49,7): error TS2322: Type 'MSGraphClient | MSGraphClient' is not assignable to type 'MSGraphClient'. [10:05:12] [tsc] Type 'import("C:/Sharepoint/sp-dev-fx-webparts-main/samples/react-birthdays/node_modules/@microsoft/sp-application-base/node_modules/@microsoft/sp-http/dist/index-internal").MSGraphClient' is not assignable to type 'import("C:/Sharepoint/sp-dev-fx-webparts-main/samples/react-birthdays/node_modules/@microsoft/sp-http/dist/index-internal").MSGraphClient'. [10:05:12] [tsc] Types have separate declarations of a private property '_createGraphClientInstance'. [10:05:12] Error - 'tsc' sub task errored after 9.19 s exited with code 2 [10:05:12] 'build' errored after 12 s [10:05:12] 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 PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays>

Steps to reproduce

  1. NPM Install
  2. gulp build

Expected behavior

The gulp would build it :)

Target SharePoint environment

SharePoint Online

Developer environment

Windows

Browsers

Node.js version

14.15.5

Additional environment details

PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays> npm outdated Package Current Wanted Latest Location Depended by @microsoft/loader-set-webpack-public-path 3.4.5 3.4.5 4.0.0 node_modules/@microsoft/loader-set-webpack-public-path react-birthdays @microsoft/set-webpack-public-path-plugin 2.4.0 2.4.0 3.0.1 node_modules/@microsoft/set-webpack-public-path-plugin react-birthdays @microsoft/sp-lodash-subset 1.8.2 1.8.2 1.13.1 node_modules/@microsoft/sp-lodash-subset react-birthdays @microsoft/sp-office-ui-fabric-core 1.8.2 1.8.2 1.13.1 node_modules/@microsoft/sp-office-ui-fabric-core react-birthdays @microsoft/sp-tslint-rules 1.8.2 1.8.2 1.13.1 node_modules/@microsoft/sp-tslint-rules react-birthdays @pnp/common 1.3.11 1.3.11 2.11.0 node_modules/@pnp/common react-birthdays @pnp/graph 1.3.11 1.3.11 2.11.0 node_modules/@pnp/graph react-birthdays @pnp/logging 1.3.11 1.3.11 2.11.0 node_modules/@pnp/logging react-birthdays @pnp/odata 1.3.11 1.3.11 2.11.0 node_modules/@pnp/odata react-birthdays @pnp/sp 1.3.11 1.3.11 2.11.0 node_modules/@pnp/sp react-birthdays @pnp/spfx-controls-react 1.10.0 1.10.0 3.5.0 node_modules/@pnp/spfx-controls-react react-birthdays @pnp/spfx-property-controls 1.12.0 1.12.0 3.3.0 node_modules/@pnp/spfx-property-controls react-birthdays @types/chai 3.4.34 3.4.34 4.3.0 node_modules/@types/chai react-birthdays @types/es6-promise 0.0.33 0.0.33 3.3.0 node_modules/@types/es6-promise react-birthdays @types/mocha 2.2.38 2.2.38 9.1.0 node_modules/@types/mocha react-birthdays @types/react 16.7.22 16.7.22 17.0.38 node_modules/@types/react react-birthdays @types/react-dom 16.8.0 16.8.0 17.0.11 node_modules/@types/react-dom react-birthdays @types/webpack-env 1.13.1 1.13.1 1.16.3 node_modules/@types/webpack-env react-birthdays ajv 5.2.5 5.2.5 8.9.0 node_modules/ajv react-birthdays office-ui-fabric-react 6.143.0 6.143.0 7.180.3 node_modules/office-ui-fabric-react react-birthdays react 16.9.0 16.14.0 17.0.2 node_modules/react react-birthdays react-dom 16.7.0 16.7.0 17.0.2 node_modules/react-dom react-birthdays PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays>

ghost commented 2 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

hugoabernier commented 2 years ago

@hilmarj1 can you confirm what version of gulp is currently installed?

hilmarj1 commented 2 years ago

PS C:\Sharepoint\sp-dev-fx-webparts-main\samples\react-birthdays> gulp -v CLI version: 2.3.0 Local version: 4.0.2

I am guessing that the CLI and local version do need to be the same :)?

Abderahman88 commented 2 years ago

@hilmarj1 This webpart is made in SPFx version 1.8.2

Use Node v8 or v10 (see SPFx development environment compatibility)

Abderahman88 commented 2 years ago

@hugoabernier Think this one can be closed 👍