-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update error for failing to load SWC bindings (#30269)
- Loading branch information
Showing
4 changed files
with
63 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SWC Failed to Load | ||
|
||
#### Why This Message Occurred | ||
|
||
Next.js now uses Rust-based compiler [SWC](https://swc.rs/) to compile JavaScript/TypeScript. This new compiler is up to 17x faster than Babel when compiling individual files and up to 5x faster Fast Refresh. | ||
|
||
SWC requires a binary be downloaded that is compatible specific to your system. In some cases this binary may fail to load either from failing to download or an incompatibility with your architecture. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
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 | ||
{ | ||
"presets": ["next/babel"] | ||
} | ||
``` | ||
|
||
Be sure to report the issue on [the feedback thread](https://github.com/vercel/next.js/discussions/30174) sharing the below information so we can get it fixed: | ||
|
||
- your node architecture and platform `node -e 'console.log(process.arch, process.platform)'` | ||
- your operating system version and CPU | ||
- your Next.js version `yarn next --version` | ||
- your package manager (`yarn` or `npm`) and version | ||
- your node.js version `node -v` | ||
- whether `@next/swc-<your-system-version>` was downloaded in `node_modules` correctly | ||
|
||
### Useful Links | ||
|
||
- [SWC Feedback Thread](https://github.com/vercel/next.js/discussions/30174) | ||
- [SWC Disabled Document](https://nextjs.org/docs/messages/swc-disabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters