Skip to content

Resolve error: Failed to load native binding #446

Closed
@almunnings

Description

@almunnings

Since upgrading past 3.8.7 the native binding has broken our workflow.

We use a container to install node and node dependencies and compile code, and then the local vscode does the linting locally.

Forgive me I am not an expert in eslint or node.

Container = linux node 20
Host = macos with vscode

Resolve error: Failed to load native binding
    at Object.<anonymous> (/Users/al/Sites/REDACTED/node_modules/unrs-resolver/index.js:372:11)
    at Module._compile (node:internal/modules/cjs/loader:1484:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
    at Module.load (node:internal/modules/cjs/loader:1295:32)
    at Module._load (node:internal/modules/cjs/loader:1111:12)
    at c._load (node:electron/js2c/node_init:2:16955)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/al/Sites/REDACTED/node_modules/eslint-import-resolver-typescript/lib/index.cjs:8:20)

With @typescript-eslint/parser and projectService: true - this tool chain is now unusable. We are unable to lint code and have it installed in a controlled environment.

I attempted the suggested workarounds of NAPI_RS_FORCE_WASI=true yarn add @unrs/resolver-binding-wasm32-wasi but that won't install on an arm64 processor.

error @unrs/resolver-binding-wasm32-wasi@1.7.2: The CPU architecture "arm64" is incompatible with this module.

Our only solution is to downgrade to 3.8.7 to avoid interruption.

Is there a solution out there for me to compile within a container and lint locally? (I'd think this is fairly common practice for some websites.)

I'd need a way to optionally choose to not use the urns/resolver binary, or to optionally choose a binary based on some other factor. Or ideally a fallback is available somehow if the binary is unusable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions