-
-
Notifications
You must be signed in to change notification settings - Fork 69
Failed to load native binding (Node 22) #447
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
Comments
What environment are you running on? For example, what's the platform? What's the arch? |
Environment: Works when running eslint from Terminal outside VS Code but doesn't work inside VS Code. (Also seems to work well in other IDEs like Cursor) VS Code information: Probable reason of failure: When you install dependencies, Yarn uses your terminal Node version (v22, x86_64). But VS Code runs ESLint using its bundled Node (v20, arm64). So the native module is not compatible with VS Code’s runtime. This mismatch leads to the Failed to load native binding error only in VS Code, even though things work in the terminal. |
I'm not sure to understand why there are two arches between your terminal and VSCode? That's said, can you:
|
Thanks @JounQin for a your quick reply! I can verify that setting |
@valleywood Thanks for verification, I'll close this one then because it's out of scope. |
Updated from version 3.8.3 to version 4.3.4 i started getting the following error in VS Code for all my ts/tsx files: (also getting the same error if updating to version v3.10.1 for example)
The error appears on the first line of every ts file for example:
import React from 'react';
The error I'm getting is this:
Reverting to 3.8.3 makes the error disappear.
ChatGpt suggests the following:
This error is due to a native module (likely unrs-resolver) failing to load properly inside a Node + Electron context (as seen from the node:electron/js2c/node_init path). This happens when the native module binary is built for a different runtime than what is trying to use it.
This specific error is often seen with eslint-import-resolver-typescript@4+, which depends on unrs-resolver, a Rust-native module. It's not compatible with Electron or mismatched Node builds unless carefully rebuilt for that environment.
The text was updated successfully, but these errors were encountered: