[Bug]: Yarn 3 support?
See original GitHub issueWhich Remix packages are impacted?
remix(Remix core)create-remix
What version of Remix are you using?
1.0.5
Steps to Reproduce
Trying to install dependencies with Yarn berry. My current Yarn version is v3.2.0-rc.5.
Log file:
# This file contains the result of Yarn building a package (azat-io@workspace:.)
# Script name: postinstall
(node:67592) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
EROFS: read-only filesystem, open '/node_modules/remix/package.json'
Dependencies in my package.json:
{
"dependencies": {
"@remix-run/node": "1.0.5",
"@remix-run/react": "1.0.5",
"@remix-run/serve": "1.0.5",
"@remix-run/server-runtime": "1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"remix": "1.0.5"
},
"devDependencies": {
"@remix-run/dev": "1.0.5",
"@types/react": "17.0.24",
"@types/react-dom": "17.0.9",
"typescript": "4.1.2"
}
}
Expected Behavior
Installation successful
Actual Behavior
Installation failed
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:41 (20 by maintainers)
Top Results From Across the Web
Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >Migrating a monorepo from Lerna to Yarn 3 with PnP and Zero ...
... decided to migrate to the recently announced [Yarn 3][yarn-3] with PnP support. ... anyway I could but I kept getting either this...
Read more >Build fails when trying to use latest Yarn v 3.0.2 - Support
I am trying to upgrade my project to use the latest yarn (v3.0.2) and I see Netlify build is ... 10:54:41 PM: Error...
Read more >Advanced package manager features for npm, Yarn, and pnpm
Modules can (accidentally) access packages they don't depend on, which can lead to bugs; The flattening algorithm is a time-consuming I/O ...
Read more >Getting started with Yarn 2 and TypeScript | by xsmith - Medium
However, Yarn 3 is now out, and I'd recommend reading my updated ... how Yarn functions as a whole, with limited support and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I made some more progress! The build now runs fine with PnP and the dev server starts up correctly as well. To test my changes:
Clone and build my changed version of remix:
In the project you want to use yarn PnP in:
yarn set version canary. Yarn < 3.2.0 has a bug preventing remix to work with PnP.remixdependency from yourpackage.json, it just doesn’t work with PnP right now (I’ll see what I can do about that next)remix setup nodefrom yourpostinstallscript. It will fail when using PnPresolutionsentry to yourpackage.json: This makes sure you’re using the patched@remix-run/*versions instead of the original ones throughout your whole projectyarn add @yarnpkg/esbuild-plugin-pnp. This is an optional peer dependency I’ve added to@remix-run/devthat you’ll need when using PnP for the esbuild build to go throughyarn add express.@remix-run/servedepends on it as a peer dependency. Depending on your setup, you might be able to get away with adding express as a peer dependency insteadremixpackage to imports from@remix-run/*packages. E.g.:RemixBrowser→@remix-run/react/browserEntryContext,MetaFunction→@remix-run/server-runtime(you might have to add a dependency to@remix-run/server-runtimeto your project as well)@remix-run/reactAfter that, you should be able to start the dev server using
yarn devas usual.I hope I didn’t forget anything. I’ll draft a PR once I get around to get the
remixpackage to work with PnP.@tavoyne #1316 should be ready for merging, but feel free to test it yourself! Everything should work as long as you don’t import anything from the
remixpackage and use the@remix-run/*packages directly instead. Also check out the README from the yarn example I added in the PR: https://github.com/remix-run/remix/blob/7af1ed35603839d85866d3d793ecc89c2244236b/examples/yarn-pnp/README.md