From 7576a1dff4f8535e32a0a7d425fc53f08a92442f Mon Sep 17 00:00:00 2001 From: Rich Harris <richard.a.harris@gmail.com> Date: Wed, 14 Apr 2021 14:39:25 -0400 Subject: [PATCH 1/2] recommend against using yarn --- documentation/faq/80-integrations.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documentation/faq/80-integrations.md b/documentation/faq/80-integrations.md index 63575eafaf04..851cba7bab13 100644 --- a/documentation/faq/80-integrations.md +++ b/documentation/faq/80-integrations.md @@ -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? + +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. From de5d04d7a5287adbb69995fc6faa5e5a933ddf98 Mon Sep 17 00:00:00 2001 From: Rich Harris <richard.a.harris@gmail.com> Date: Fri, 16 Apr 2021 17:42:11 -0400 Subject: [PATCH 2/2] link to issue --- documentation/faq/80-integrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/faq/80-integrations.md b/documentation/faq/80-integrations.md index 851cba7bab13..0bba9f491c80 100644 --- a/documentation/faq/80-integrations.md +++ b/documentation/faq/80-integrations.md @@ -16,4 +16,4 @@ You probably don't need it. We'd generally recommend you just use `fetch` instea ### 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. +Sort of. The Plug'n'Play feature, aka 'pnp', is broken (it deviates from the Node module resolution algorithm, and [doesn't yet work with native JavaScript modules](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 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.