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

[Bug]: yarn rw dev fails on yarn 4 node 20 #9578

Closed
1 task done
Tobbe opened this issue Nov 27, 2023 · 5 comments
Closed
1 task done

[Bug]: yarn rw dev fails on yarn 4 node 20 #9578

Tobbe opened this issue Nov 27, 2023 · 5 comments
Labels
bug/confirmed We have confirmed this is a bug topic/cli topic/docs

Comments

@Tobbe
Copy link
Member

Tobbe commented Nov 27, 2023

What's not working?

Using yarn 4 and node 20
image

yarn create redwood-app complains about the node version, but ultimately successfully finishes
image

yarn install finishes OK, but does complain about fsevents
image

Running yarn redwood dev fails, complaining about fsevents
image

And here's some of the output as text, for easier searching:

❯ yarn install
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + fsevents@patch:fsevents@npm%3A1.2.13#optional!builtin<compat/fsevents>::version=1.2.13&hash=d11327, and 4 more.
➤ YN0085: │ - fsevents@patch:fsevents@npm%3A1.2.13#~builtin<compat/fsevents>::version=1.2.13&hash=d11327, and 4 more.
➤ YN0000: └ Completed in 13s 928ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ react is listed by your project with version 18.2.0, which doesn't satisfy what @redwoodjs/router (p1eae0) and other dependencies request (but they have non-overlapping ranges!).
➤ YN0060: │ react-dom is listed by your project with version 18.2.0, which doesn't satisfy what @redwoodjs/router (p62015) and other dependencies request (but they have non-overlapping ranges!).
➤ YN0002: │ web@workspace:web doesn't provide graphql (pc345c), requested by @redwoodjs/forms.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 1948 packages were added to the project (+ 410.53 MiB).
➤ YN0000: └ Completed in 6s 64ms
➤ YN0000: ┌ Link step
➤ YN0007: │ core-js@npm:3.33.2 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.33.2 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.18.19 must be built because it never has been before or the last one failed
➤ YN0007: │ msw@npm:1.3.2 [114c5] must be built because it never has been before or the last one failed
➤ YN0007: │ fsevents@patch:fsevents@npm%3A1.2.13#optional!builtin<compat/fsevents>::version=1.2.13&hash=d11327 must be built because it never has been before or the last one failed
➤ YN0007: │ @prisma/client@npm:5.6.0 [78cce] must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0007: │ @prisma/engines@npm:5.6.0 must be built because it never has been before or the last one failed
➤ YN0007: │ prisma@npm:5.6.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 6s 471ms
➤ YN0000: · Done with warnings in 26s 585ms
❯ yarn redwood dev
✔ Generating the Prisma client...
web | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
web |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
web |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
web |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
web |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
web |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
api | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
api |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
api |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
api |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
api |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
api |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
gen | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
gen |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
gen |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
gen |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
gen |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
gen |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
web | yarn cross-env NODE_ENV=development rw-vite-dev  exited with code 1
api | yarn cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --quiet --watch "/Users/tobbe/tmp/rw-yarn-4/redwood.toml" --exec "yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter" exited with code 1
gen | yarn rw-gen-watch exited with code 1

This was first reported on our forums over here: https://community.redwoodjs.com/t/yarn-redwood-dev-throwing-internal-error/5557

How do we reproduce the bug?

❯ cd ~
❯ corepack enable
❯ yarn set version stable
➤ YN0000: Retrieving https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.0.2.cjs
➤ YN0000: Done in 0s 469ms
❯ cd ~/tmp

Verify that yarn 4 is the global version

❯ yarn -v
4.0.2

Switch to node 20

❯ n 20
  installing : node-v20.10.0
       mkdir : /usr/local/n/versions/node/20.10.0
       fetch : https://nodejs.org/dist/v20.10.0/node-v20.10.0-darwin-arm64.tar.xz
     copying : node/20.10.0
   installed : v20.10.0 (with npm 10.2.3)

Create a new RW project

❯ yarn create redwood-app -y rw-yarn-4
❯ cd rw-yarn-4
❯ yarn install

Finally try running your project, and you'll see the error messages

❯ yarn redwood dev
✔ Generating the Prisma client...
web | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
web |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
web |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
web |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
web |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
web |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
api | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
api |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
api |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
api |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
api |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
api |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
gen | Internal Error: fsevents@patch:fsevents@npm%3A~2.3.2#~builtin<compat/fsevents>: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
gen |     at X0.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:436:5149)
gen |     at Rf.getCandidates (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:392:1264)
gen |     at /Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8033
gen |     at Cf (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:391:11070)
gen |     at ue (/Users/tobbe/tmp/rw-yarn-4/.yarn/releases/yarn-3.7.0.cjs:440:8013)
web | yarn cross-env NODE_ENV=development rw-vite-dev  exited with code 1
api | yarn cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --quiet --watch "/Users/tobbe/tmp/rw-yarn-4/redwood.toml" --exec "yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter" exited with code 1
gen | yarn rw-gen-watch exited with code 1

What's your environment? (If it applies)

❯ yarn rw info

  System:
    OS: macOS 14.1.1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - /private/var/folders/7j/9p56mwmj6jsfdr2h5_884j9w0000gn/T/xfs-4e32de2c/node
    Yarn: 3.7.0 - /private/var/folders/7j/9p56mwmj6jsfdr2h5_884j9w0000gn/T/xfs-4e32de2c/yarn
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Safari: 17.1
  npmPackages:
    @redwoodjs/core: 6.4.0 => 6.4.0

Are you interested in working on this?

  • I'm interested in working on this
@Tobbe Tobbe added the bug/needs-info More information is needed for reproduction label Nov 27, 2023
@Tobbe
Copy link
Member Author

Tobbe commented Nov 27, 2023

Downgraded to node 18, but kept yarn 4. Still get the same error

@Tobbe
Copy link
Member Author

Tobbe commented Nov 27, 2023

Went back up to node 20, but downgraded yarn to 3.7.0. Now everything works.
yarn set version 3 is the workaround for this issue for now ✅

@Tobbe
Copy link
Member Author

Tobbe commented Nov 27, 2023

Another thing that works is:

❯ yarn create redwood-app -y rw-yarn-4
❯ cd rw-yarn-4
❯ yarn set version 4
❯ yarn install
❯ yarn rw dev

That is, updating the project itself to use yarn 4 makes it all work.

(Do note that it still complains about fsevents when installing, but doesn't error out when running)
image

@Tobbe
Copy link
Member Author

Tobbe commented Nov 27, 2023

To me this is starting to look like a bug with yarn. Shouldn't it use yarn 3 inside the project directory since we have "packageManager": "[email protected]"? I'll try to get @jtoar's eyes on this too. He has more experience with yarn than I do

@Tobbe Tobbe added bug/confirmed We have confirmed this is a bug and removed bug/needs-info More information is needed for reproduction labels Nov 28, 2023
jtoar added a commit that referenced this issue Nov 28, 2023
Fix for #9578 and
https://community.redwoodjs.com/t/yarn-redwood-dev-throwing-internal-error/5557.
@Tobbe and I paired on this one. Basically, there's a footgun in the
yarn docs. If you read them too quickly, it seems like you can update
your global version of yarn via `yarn set version stable`. But that
command is actually only meant to be used in the context of a project
(like a Redwood app).
jtoar added a commit that referenced this issue Nov 29, 2023
Fix for #9578 and
https://community.redwoodjs.com/t/yarn-redwood-dev-throwing-internal-error/5557.
@Tobbe and I paired on this one. Basically, there's a footgun in the
yarn docs. If you read them too quickly, it seems like you can update
your global version of yarn via `yarn set version stable`. But that
command is actually only meant to be used in the context of a project
(like a Redwood app).
@Tobbe
Copy link
Member Author

Tobbe commented Dec 4, 2023

Fixed by updating our documentation in #9579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug topic/cli topic/docs
Projects
None yet
Development

No branches or pull requests

1 participant