Skip to content

Commit

Permalink
Add Yarn 2 section to FAQ (#1027)
Browse files Browse the repository at this point in the history
* recommend against using yarn

* link to issue
  • Loading branch information
Rich Harris committed Apr 16, 2021
1 parent e9c98dc commit eacd330
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions documentation/faq/80-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,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 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.

0 comments on commit eacd330

Please sign in to comment.