next.js: Failed to load SWC binary for linux/x64
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Dec 18 16:34:56 UTC 2020 Binaries: Node: 16.15.1 npm: 8.11.0 Yarn: N/A pnpm: 7.4.0 Relevant packages: next: 12.2.1 eslint-config-next: 12.2.0 react: 17.0.2 react-dom: 16.14.0
What browser are you using? (if relevant)
Chrome 102
How are you deploying your application? (if relevant)
next start
Describe the Bug
my project in gitlab-ci(image: node:lts-buster) buid my app.
run next build
i get this error
↓
info - Skipping linting
info - Creating an optimized production build...
info - Downloading WASM swc package...
info - Using experimental wasm build of next-swc
warn - Attempted to load @next/swc-linux-x64-gnu, but it was not installed
warn - Attempted to load @next/swc-linux-x64-gnux32, but it was not installed
warn - Attempted to load @next/swc-linux-x64-musl, but an error occurred: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory
Failed to compile.```
how can i fix it
### Expected Behavior
null
### Link to reproduction
null
### To Reproduce
null
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 15 (3 by maintainers)
Commits related to this issue
- Downgrade next for linux compatibility See: https://github.com/vercel/next.js/issues/38436 — committed to rlenkov/rppd-app by rlenkov 2 years ago
Downgrade to 12.2.0 works fine.
I had the same problem too, but I was able to take a temporary solution. The version of OpenSSL installed on AmazonLinux 2 is 1.0.2, so I was able to solve the problem by installing OpenSSL 1.1.1. I thought it would work by installing OpenSSL 1.1.1 in the same way in all Linux environments where OpenSSL 1.0.x is installed.
Example of installing OpenSSL 1.1.1 on AmazonLinux 2.
I fixed the bug, and by then I forgot to reply to this issue. and the reason I had this problem was because, my gitlab image was chosen incorrectly, I chose the
node:lts-alpine
docker image in thepnpm install
stage, but I chosenode:lts-buster
in thebuild
stage and runnext build
, and when I unified the mirroring docker image tonode:lts-alpine
of the two stages, I fixed the problem.I’m seeing something similar to this on
12.2.1
using a self-hosted actions runner:I’m seeing this issue even though I followed this document:
I’m also seeing this when trying to run
next build
on an EC2 server:The build seems to be stalling indefinitely.