-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bindings not found error #74
Comments
Hi! I can't repro for now. Do you have any more info on when this happening? This mostly like an install issue or an issue with SWC directly. What OS are you using? |
Hello, The problem it happens when run vite build or server.
|
Did this happen after an update of SWC? |
This happend after update typescript, the version @vitejs/plugin-react-swc is "^3.0.0" |
That's strange I don't see any related issues on the SWC repo. |
This happend after update typescript
I had a project I just updated the typescript to version 5 |
Hey @ArnaudBarre. OS: Microsoft 11 |
@SANTOrick so you got the error without TS 5? Can people that have the issue also share their OS, node version and SWC installed version? |
OS: macOS Ventura 13.2 (Intel) I got the same error. We have fixed the problem with running this command:
In the end just installing swc as described here: https://swc.rs/docs/getting-started |
What was the SWC version before and after re-intalling |
The newly installed version of @swc/core that addresses this bug for me is "@swc/core": "^1.3.46", I did not have a before version prior to this, hope this helps! |
Probably unrelated but after updating I'm seeing vite 4.2.1, swc/core 1.3.46, plugin-react-swc 3.2.0, OSX |
@ArnaudBarre here the previous and current versions after my command. Before: After: |
@proddy This was a misconfiguration of peer dependencies, this is now fixed on the latest version @Tareq1586 You still get the error with the latest version of @swc/core? |
That worked for me. |
|
Hi, just a quick bump - today we've encountered the same issue on a colleague's laptop. The interesting part is why this didn't fail on my machine for the last week or so .. Updating The culprit is actually Vite CLI. Creating a new project with
|
When starting out a new template, any package manager will install the latest version available (because of the I think there is just bad version of the SWC package that was published at some point and the solution is just to force a new version of |
I ran into this same error when: (1) using my Mac to install all packages with I never had this issue when using the babel-based https://github.com/vitejs/vite-plugin-react plugin. I also did not see this error when running the dev server directly from my Mac. I was able to resolve it temporarily by opening a shell in the Docker image and running a
My supportedArchitectures:
os:
- current
- linux But it turns out that's currently not sufficient for SWC swc-project/swc#2898. The workaround suggested there swc-project/swc#2898 (comment) of adding the following to supportedArchitectures:
os:
- current
- linux
libc:
- current
- glibc |
@sjdemartini Yeah this is totally expected because SWC is using native binaries. |
I just encountered this issue but it happens only very recently out of nowhere.
Edit: The issue is resolved after manually run |
In case repro needed, I have just initialized a fresh project and encountered this issue. Exact commands from in later commits, there's results of and then a result of rerun of |
We noticed this problem after "refreshing" See minimal reproduction in GitHub and StackBlitz. The most reliable workaround I found is to force-install the optional dependencies of npm install --force --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 Then check the resulting lockfile into source control. |
@tony19 Seems like a bug in npm. What version of npm are you using? |
@ArnaudBarre npm v9.5.0, node v18.14.2 |
Wow just reproduced with npm 9.5.1. What a bug. |
Thanks for finding that issue. That's my exact scenario. I'll try spelunking npm source this weekend and submitting a PR if I can. In the meantime, I think recommending installing the optional deps somewhere (README?) would be helpful. |
PR got merged. I think the problem should be fix at this toolimg plugins level. kat-tax/vslite#14 one to detect web containers, one to import a fallback. |
|
I can reproduce this error on Termux from FreeDroid. Nestbox registers as linux-arm64, while termux requires android-arm64 builds. In Go this is an easy thing to fix... and I've |
finally what we should do to solve this error? when ever i pull a branch i got this error and to fix it i havt to delete node-modules and yarn install to fix it. and some packages dont get install well after this. like redux toolkit |
I can confirm I'm experiencing this on an M2 mac. Interestingly enough, I notice data corruption warnings coming from my company's JFrog Artifactory instance, which acts as a reverse proxy out to the NPMJS registry. Was a corrupted build of the SWC Plugin pushed out at some point?
For those that are still stuckTry using the standard // vite.config.ts
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
},
}); |
clone the repo could be a temp solution. |
my issues: Error: Bindings not found when start the taro project, it has been this error, when I run 'npm i -D @swc/cli @swc/core', the issue has been solved. Thank you for your answer. |
I have exact same problem... error message : bindings not found |
I couldn't find a solution for
Initial the project worked well in my previous laptop but has been failling on my current one and having tried the recommendations posted here , the results was the same. My temporary solution for now was to:
|
go https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 and download the [ Visual Studio 2015, 2017, 2019, and 2022 ], I try to download x64 version, then remove node_modules and reinstall, it works for me. |
Why this issue is closed? I am getting same error with latest vite. |
I just wanted to let you know that it works for me. Using a Macbook Pro on MacOS Sonoma 14.1.1 with Intel processor |
Getting this same error. Weirdly enough it behaves differently based on the base docker image of bun. On Apple silicon(arm arch) with Docker desktop. SWC doesn't work with: |
Had same issue. Come from nowhere. Was actively working on the project and suddenly i got this error. Params
Fixed by: Just make sure that by deleting the "package-lock.json" and reinstalling doesn't break your dependencies by unintentionally installing/updating to major package versions. |
npm update worked for me with similar scenarios. Don't knonw if already answered though. |
for Android arm64 use this command or if you use npm keep in mind that this package hasn't been updated in a while, at the time of writing this comment, latest swc core package version is but atleast it works |
If it can help my problem was that my runner was running on an image of node:18.13.0 and my project was on node:18.17.0. Update my runner image to node:18.17.0 solved the Binding not found issue for me |
Hey there
If you have this problem, you probably ran into is npm/cli#4828. The bug happens when npm generates the lockfile with an existing node_modules that contains platform-specific dependencies.
Two solutions:
rm -rf node_modules package-lock.json && npm i
Original post
Running
vite
we occasionally come across with this error. The way we found to overcome this was to remove node_modules and reinstall it. Do you guys have any ideas what is causing this?The text was updated successfully, but these errors were encountered: