-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add Yarn 2 section to FAQ #1027
Conversation
Yarn 3 fixes the problem |
@@ -13,3 +13,7 @@ Put the code to query your database in [endpoints](../docs#routing-endpoints) - | |||
### How do I use Axios? | |||
|
|||
You probably don't need it. We'd generally recommend you just use `fetch` instead. If you insist, you're probably better off using the ESM drop-in replacement `redaxios` [until axios utilizes ESM](https://github.com/axios/axios/issues/1879). Finally, if you still want to use Axios itself, try putting it in `optimizeDeps.include`. | |||
|
|||
### Does it work with Yarn 2? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Does it work with Yarn 2? | |
### Does it work with Yarn PnP? |
Yarn 1 and pnpm support PnP
documentation/faq/80-integrations.md
Outdated
|
||
### Does it work with Yarn 2? | ||
|
||
Sort of. The Plug'n'Play feature, aka 'pnp', is broken (it deviates from the Node module resolution algorithm, and doesn't work with native JavaScript modules which SvelteKit — along with an [increasing number of packages](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77) — uses). You can use `nodeLinker: 'node-modules'` in your [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) file to disable pnp, but it's probably easier to just use npm or [pnpm](https://pnpm.io/), which is similarly fast and efficient but without the compatibility headaches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of. The Plug'n'Play feature, aka 'pnp', is broken (it deviates from the Node module resolution algorithm, and doesn't work with native JavaScript modules which SvelteKit — along with an [increasing number of packages](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77) — uses). You can use `nodeLinker: 'node-modules'` in your [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) file to disable pnp, but it's probably easier to just use npm or [pnpm](https://pnpm.io/), which is similarly fast and efficient but without the compatibility headaches. | |
Sort of. The Plug'n'Play feature, aka 'pnp', [doesn't work with native JavaScript modules yet](https://github.com/yarnpkg/berry/issues/638) which SvelteKit — along with an [increasing number of packages](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77) — uses). You can use `nodeLinker: 'node-modules'` in your [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) file for Yarn 2+ to use the `node_modules` layout instead. |
A Yarn maintainer confirmed that this isn't the case, at least not yet. @merceyz thank you for the review. We stand by the wording here though — PnP is broken if the threshold is parity with Node's default behaviour, for the two reasons given. It's true that it's possible to disable PnP, but as long as it's the default it will continue to cause confusion in the JS ecosystem. As maintainers who have been affected by that confusion we feel that the recommendation to use alternative package managers is justified. |
Is this still true after PRs yarnpkg/berry#2161 and yarnpkg/berry#3667 got merged? From a cursory glance it seems like PnP supports ES Modules now — can anyone confirm if that means Yarn 3.1+ work with SvelteKit? @Rich-Harris |
We don't use yarn, but you are welcome to try it out and report back if it works now |
#993.
Before submitting the PR, please make sure you do the following
Tests
pnpm test
and lint the project withpnpm lint
Changesets
pnpx changeset
and following the prompts