Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp Build not working on react-calendar #5209

Closed
1 of 9 tasks
SharePointPro opened this issue Aug 19, 2024 · 7 comments
Closed
1 of 9 tasks

Gulp Build not working on react-calendar #5209

SharePointPro opened this issue Aug 19, 2024 · 7 comments
Labels
sample: react-calendar Stale status:wrong-author type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs

Comments

@SharePointPro
Copy link

Disclaimer

Yes

Sample

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

Contributor(s)

Hugo Bernier Peter Paul Kirschner

What happened?

When using the recommended node version 12.13.0 (64 bit), and running NPM install from a clean clone, the error

code: 'MODULE_NOT_FOUND',

occurs when running gulp build

Full Error:
`PS C:\sppro2\Libraries\react-calendar> gulp build --ship
Error: Cannot find module 'node:process'
Require stack:

  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\rush-lib.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\lib\index.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\lib\plugins\devDeployPlugin\SpDevDeploy.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\lib\index.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\sp-build-core-tasks\lib\webpack\ConfigureWebpackTask.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\sp-build-core-tasks\lib\index.js
  • C:\sppro2\Libraries\react-calendar\node_modules@microsoft\sp-build-web\lib\index.js
  • C:\sppro2\Libraries\react-calendar\gulpfile.js
  • C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
  • C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned^4.0.0\index.js
  • C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
  • C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.497742 (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\rush-lib.js:494:18)
    at webpack_require (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\rush-lib.js:595:41)
    at Object.574471 (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\commons.js:16917:70)
    at webpack_require (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\rush-lib.js:595:41)
    at Object.541976 (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\commons.js:247:88)
    at webpack_require (C:\sppro2\Libraries\react-calendar\node_modules@microsoft\spfx-heft-plugins\node_modules@microsoft\rush-lib\dist\rush-lib.js:595:41) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\spfx-heft-plugins\node_modules\@microsoft\rush-lib\dist\rush-lib.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\spfx-heft-plugins\node_modules\@microsoft\rush-lib\lib\index.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\spfx-heft-plugins\lib\plugins\devDeployPlugin\SpDevDeploy.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\spfx-heft-plugins\lib\index.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\sp-build-core-tasks\lib\webpack\ConfigureWebpackTask.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\sp-build-core-tasks\lib\index.js',
    'C:\sppro2\Libraries\react-calendar\node_modules\@microsoft\sp-build-web\lib\index.js',
    'C:\sppro2\Libraries\react-calendar\gulpfile.js',
    'C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js',
    'C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js',
    'C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js',
    'C:\Users\tipha\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js'
    ]
    }`

Steps to reproduce

  1. Clone sp-dev-fx-webparts
  2. Have Node 12.13.0 installed
  3. Run npm install in react-calendar folder
  4. run gulp build

Expected behavior

The app to build correctl;y

Target SharePoint environment

SharePoint Online

Developer environment

Windows

Browsers

  • Internet Explorer
  • Microsoft Edge
  • Google Chrome
  • FireFox
  • Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

What version of Node.js is currently installed on your workstation?

12.13.0

What version of Node.js is required by the sample?

12.13.0

Paste the results of SPFx doctor

C:\Users\tipha\AppData\Roaming\nvm\v12.13.0\node_modules@pnp\cli-microsoft365\dist\index.js:2
import { cli } from './cli/cli.js';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:892:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11

Additional environment details

I have also tried on node 13, 14, 10,

@SharePointPro SharePointPro added the type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs label Aug 19, 2024
Copy link

github-actions bot commented Sep 1, 2024

Wrong or missing contributor @mentions

Thank you for your submission, but you appear to have forgotten to @mention the sample author(s).

To help increase your chances of getting assistance from the original authors of the sample, you should make sure to @mention the actual authors (and not the repository maintainers).

Make sure to include the @ character before the GitHub username so that the author(s) get notified; using the person's name is not going to work.

Please note that the sample authors will not get notified about this issue unless you update this issue accordingly.

You can find the author(s) of each sample in the sample's README.md, under Solution.

We'll automatically close this issue in 7 days unless you update the issue.

For more information on how to create a good issue, refer to our wiki for more information: How to Create Good Issues

Copy link

github-actions bot commented Sep 4, 2024

Please note that this issue will be closed within 24 hours because it has been flagged as having invalid authors. Read the guidance and @mention the authors so they can respond to you.

@github-actions github-actions bot added the Stale label Sep 4, 2024
Copy link

github-actions bot commented Sep 5, 2024

Closing this issue due to lack of response. Feel free to open a new issue, but make sure to follow the guidance on how to create good issues and @mention the authors so they can respond to you.

@github-actions github-actions bot closed this as completed Sep 5, 2024
@TracyGH
Copy link

TracyGH commented Sep 24, 2024

@SharePointPro - I'm having the exact same issue you've described here with the react-calendar sample.
Were you able to resolve it? And if so, how?
Thanks! 😊

@SharePointPro
Copy link
Author

No, I did't find a solution.

@hugonallet
Copy link

Hi @SharePointPro and @TracyGH, I have the same issue here because of another module. I'm still trying to find a way... I'll let you know if I ever achieve a miracle

@hugonallet
Copy link

UPDATE
To solve this specific issue I founded this stackoverflow page : Here

That's mean you need to change the version of node.js. again. I use this one : nvm use 14.18.0
After this the gulp build can be launch "correctly", but I still have an error with node comptability lol.

gulp build
Build target: DEBUG
[01:03:18] Using gulpfile C:\Dev\sp-dev-fx-webparts\samples\react-calendar\gulpfile.js
[01:03:18] Starting 'build'...
[01:03:18] Starting gulp
[01:03:18] Starting subtask 'pre-copy'...
[01:03:18] Finished subtask 'pre-copy' after 34 ms
[01:03:18] Starting subtask 'copy-static-assets'...
[01:03:18] Starting subtask 'sass'...
[01:03:19] Finished subtask 'sass' after 1.27 s
[01:03:19] Starting subtask 'lint'...
[01:03:19] [lint] tslint version: 5.20.1
[01:03:19] Starting subtask 'tsc'...
[01:03:19] [tsc] typescript version: 3.9.10
[01:03:19] Finished subtask 'copy-static-assets' after 1.5 s
[01:03:38] Error - [tsc] node_modules/@types/react-big-calendar/node_modules/@types/react/ts5.0/index.d.ts(3347,50): error TS1110: Type expected.
[01:03:38] Error - [tsc] node_modules/@types/react-big-calendar/node_modules/@types/react/ts5.0/index.d.ts(3348,51): error TS1110: Type expected.
[01:03:38] Error - [tsc] node_modules/@types/react-big-calendar/node_modules/@types/react/ts5.0/index.d.ts(3349,48): error TS1110: Type expected.
[01:03:38] Error - [tsc] node_modules/@types/react-big-calendar/node_modules/@types/react/ts5.0/index.d.ts(3349,91): error TS1005: '(' expected.
[01:03:38] Error - 'tsc' sub task errored after 19 s
exited with code 2
[01:03:38] 'build' errored after 20 s
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sample: react-calendar Stale status:wrong-author type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs
Projects
None yet
Development

No branches or pull requests

4 participants