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

react-display-hierarchy - receiving Cannot find module 'worker_threads' on using gulp bundle #5114

Open
1 of 9 tasks
Jeyeline opened this issue Apr 2, 2024 · 0 comments
Open
1 of 9 tasks
Labels
sample: react-display-hierarchy type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs

Comments

@Jeyeline
Copy link

Jeyeline commented Apr 2, 2024

Disclaimer

Yes

Sample

react-display-hierarchy

Contributor(s)

@nanddeepn @ravi16a87

What happened?

Experiencing the below error on providing the gulp bundle --ship

Error: Cannot find module 'worker_threads'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (C:\Users\blues\Downloads\Greetings\sp-dev-fx-webparts\samples\react-display-hierarchy\node_modules@rushstack\worker-pool\lib\WorkerPool.js:6:26)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3) code: 'MODULE_NOT_FOUND'

Steps to reproduce

  1. Clone the repo
  2. Execute npm i
  3. Execute gulp bundle --ship

Expected behavior

The package should be successfully build and published upon executing the next command

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?

10.24.1

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

10.X

Paste the results of SPFx doctor

import { cli } from './cli/cli.js';
^

SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Additional environment details

Gulp version

CLI version: 3.0.0
Local version: 4.0.1

@Jeyeline Jeyeline added the type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sample: react-display-hierarchy 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

2 participants