Skip to content

Commit

Permalink
Add note about lockfile causing swc to fail to load (#36484)
Browse files Browse the repository at this point in the history
* Add note about lockfile causing swc to fail to load

* Apply suggestions from code review

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
  • Loading branch information
ijjk and padmaia committed Apr 26, 2022
1 parent e442569 commit 4f5c2de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions errors/failed-loading-swc.md
Expand Up @@ -14,6 +14,10 @@ On Windows make sure you have Microsoft Visual C++ Redistributable installed. ht

Alternatively, you might need to allow optional packages to be installed by your package manager (remove `--no-optional` flag) for the package to download correctly.

In some cases your package manager (e.g. `npm`) might have generated a lockfile that only includes `optionalDependencies` specific to the platform it was generated on, preventing the `optionalDependency` needed for CI from being installed.

This can be fixed by removing the lockfile and regenerating it with a newer version of your package manager `npm i -g npm@latest`.

If SWC continues to fail to load you can opt-out by disabling `swcMinify` in your `next.config.js` or by adding a `.babelrc` to your project with the following content:

```json
Expand Down

0 comments on commit 4f5c2de

Please sign in to comment.