Open sebastianrath opened 2 years ago
@jaybe78 This is not a bug of swc
I think there is a bug in the postinstall.sh script in the swc module. Somewhere, it "trash" the @swc/wasm module instead of adding it. the script however is discarded if @swc/wasm is added in the dependencies. What fixed it for me (in my dockers in CI), is to add the package in the dependencies. But looking at the comments, i think there is multiple issues listed here, so it may not fix for everyone.
I put it again here, in case it helps someone.
adding the core modules as optional dependencies for the project fixed the error for me:
npm install --save-optional \
"@swc/core-darwin-arm64" \
"@swc/core-darwin-x64" \
"@swc/core-linux-arm-gnueabihf" \
"@swc/core-linux-arm64-gnu" \
"@swc/core-linux-arm64-musl" \
"@swc/core-linux-x64-gnu" \
"@swc/core-linux-x64-musl" \
"@swc/core-win32-arm64-msvc" \
"@swc/core-win32-ia32-msvc" \
"@swc/core-win32-x64-msvc"
you can also filter out the list of packages in case you are certain what is the OS / architecture of your development computer and the CI.
hope this helps for others until the issue is resolved!
I was having the same issue Fallback bindings does not support filesystem access.
when running in GitHub Actions.
@pcdevil 's response solved the issue - thanks!!
thanks @pcdevil that was the solution for me (when compiling react-email in docker)
I'm having this issue re-appear with @swc/core@1.3.83
(and @swc/core@1.3.84
) on Linux (Debian 12) with a mono repo using npm. If I explicitly install @swc/core@1.3.83
(or @swc/core@latest
) in my workspace it doesn't work but explicitly installing the previous version i.e., npm -w=backend i -D @swc/core@1.3.82
, is a good workaround for now.
EDIT: My issue is actually a ts-node issue. See: https://github.com/TypeStrong/ts-node/issues/2059 https://github.com/TypeStrong/ts-node/issues/2056
I can work around this by simply yarn add -D @swc/core@latest
.
just clear node_modules
files and do npm install
I worked around this with:
npm install --save-dev @swc/core@1.3.2 @swc/cli@0.1.57
npm install @swc/helpers@0.4.11
These are pretty old versions - there's likely newer ones that work, I just grabbed these from a project where I didn't have this issue.
I'm having same issue using @swc/core:1.5.2
@throrin19 there is a deprecation warning against 1.5.2
now: @swc/core@1.5.2: Mac OS installation is broken
. Upgrading to 1.5.3
fixes the issue for me (Bindings not found
when running jest)
Can someone provide a minimal repro?
@kdy1
The installation always fails on certain servers. For me specifically, in the cheap ones running on vCPUs.
uname -m
output is aarch64
lscpu
output is:
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Neoverse-N1
Model: 1
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Stepping: r3p1
BogoMIPS: 50.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
Let me know if I can provide you with nay additional information.
(We have resorted to version locking swc manually in our monorepo for now, which isn't good. )
For those still struggling heres what worked for me
I've found a fix, apparently what happens (not sure why) is node_modules/@swc/core installs wrong optional packages within docker container.
Heres the fix:
Open docker image and find your WORKDIR Remove core-darwin-x64 or core-win-32-x64-msvc or similar from node_modules/@swc/core. There should be core-linux-x64-gnu and core-linux-x64-muscl (if your docker image is linux) Run npm install from within docker container (this time you should see correct packages in @swc/core under node_modules/) My understanding is that when you pull project and do npm install on host machine which is macOS or Windows, swc installs right packages for your host system.
I'm not sure why it skips installing correct ones on docker image but this is what causes issues. I tried setting this up on windows and macbook and both times had the same issues where this was the fix.
If your problem is locally, I mean, you are using docker-compose pay attention to the shared volumes, probably it is sharing the wrong file between your windows system and your container running linux.
You can solve it excluding your node_modules from the sharing volumes from you docker-compose.yml file like this:
volumes:
- ./:/home/node/app # Here we are sharing all the content from local to your container
- /home/node/app/node_modules/ # Here we are excluding the node_modules
Describe the bug
Hi there,
I am using
@swc/core
to speedup the execution of my test suite with avajs/ava.System info: Ubuntu 20.04.1 (VM via parallels 18 on a Mac Mini Intel) node 16.15.0
During
npm run test
I receive the following error, and I am not sure how to resolve the issue.Input code
No response
Config
Snippet of
tsconfig.json
config:Playground link
No response
Expected behavior
Successful execution of
npm run test
.Actual behavior
No response
Version
v1.2.241
Additional context
No response