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

yarn create react-app and yarn start failed #1403

Closed
rjiang9 opened this issue Dec 12, 2022 · 2 comments
Closed

yarn create react-app and yarn start failed #1403

rjiang9 opened this issue Dec 12, 2022 · 2 comments

Comments

@rjiang9
Copy link

rjiang9 commented Dec 12, 2022

Envs:

  1. Mac M1
  2. volta 1.1.0
  3. yarn 3.2.1

which yarn returns .~/volta/bin/yarn

Create an react app:

yarn create react-app mydemo

cd mydemo

yarn start

And got this errro:

image

node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_LOADER_CHAIN_INCOMPLETE]: "file:///Users/rayjiang/projects/ruby-yarn/.pnp.loader.mjs 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include `shortCircuit: true` in the hook's return.
    at new NodeError (node:internal/errors:393:5)
    at ESMLoader.resolve (node:internal/modules/esm/loader:839:13)
    at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:413:7) {
  code: 'ERR_LOADER_CHAIN_INCOMPLETE'
}
t 
Node.js v19.2.0

I downgraded volta pin node@18 (node@16) does NOT help.

But if create the app using npx create-react-app mydemo, npm start works just fine.

Thanks in advance for any advice.

@charlespierce
Copy link
Contributor

Hi @rjiang9, thanks for the report! It looks like this is actually an issue with that specific Yarn version and its interaction with newer Node releases. See yarnpkg/berry#4778

From that, it looks like upgrading to Yarn 3.2.2 or newer (and potentially deleting / regenerating .pnp.loader.mjs) should resolve the issue.

@rjiang9
Copy link
Author

rjiang9 commented Dec 14, 2022

Hi @rjiang9, thanks for the report! It looks like this is actually an issue with that specific Yarn version and its interaction with newer Node releases. See yarnpkg/berry#4778

From that, it looks like upgrading to Yarn 3.2.2 or newer (and potentially deleting / regenerating .pnp.loader.mjs) should resolve the issue.

Thank you @charlespierce . Upgrading yarn to v3.2.2 and all good now.

For anybody who stump on this post: to upgrade yarn, just do yarn set version 3.2.2

@rjiang9 rjiang9 closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants