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

fix(create-gatsby): Shim worker_threads #28064

Merged
merged 1 commit into from
Nov 15, 2020
Merged

Conversation

ascorbic
Copy link
Contributor

One of the transient dependencies of create-gatsby tries to import worker_threads inside a try/catch block to find the pid, and falls-back to 0 if it can't load it. Because rollup hoists this import outside the block it fails on Node 10 where the package is behind a flag. This PR aliases worker_threads to a shim that just returns 0 for the pid.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 15, 2020
@ascorbic ascorbic added topic: cli Related to the Gatsby CLI and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Nov 15, 2020
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pieh pieh merged commit 4c400f3 into master Nov 15, 2020
@delete-merged-branch delete-merged-branch bot deleted the fix/shim-worker-threads branch November 15, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cli Related to the Gatsby CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants