Skip to content

vite-plus fails to resolve native binding @voidzero-dev/vite-plus-linux-x64-musl when installed with Bun in Docker (Alpine/musl) #992

Description

@xinyao27

Describe the bug

Environment

  • Runtime: Bun v1.3.10
  • Platform: Docker (Linux x64, musl libc — likely Alpine-based)
  • VitePlus: v0.1.12
  • Node.js: v22.22.0

Problem

vp build crashes immediately with:

Error: Cannot find native binding.
[cause]: Cannot find module '@voidzero-dev/vite-plus-linux-x64-musl'

The optional dependency @voidzero-dev/vite-plus-linux-x64-musl is not installed despite bun install completing successfully with all 611 packages
resolved.

Reproduction

In a Docker container (Alpine/musl-based)

rm -f bun.lock package-lock.json
bun install # succeeds, no errors
bun run build # runs tsc && vp build → crashes

Analysis

Bun has a known issue with optional dependencies (npm/cli#4828 referenced in the error message). The platform-specific native
binding package for linux-x64-musl is declared as an optionalDependency but Bun silently skips it without warning during install, causing a runtime
crash.

Expected Behavior

Either:

  1. VitePlus should provide a fallback (e.g., WASM) when the native binding is unavailable, or
  2. The linux-x64-musl binding should be listed in a way that Bun correctly resolves it (e.g., via overrides or explicit platform mapping)

Error logs:

RUN cd src/web-chat-react && rm -f bun.lock package-lock.json && bun install && bun run build
8s
bun install v1.3.10 (30e609e0)
Resolving dependencies
Resolved, downloaded and extracted [2356]
Saved lockfile
+ @types/react@19.2.14
+ @types/react-dom@19.2.3
+ typescript@5.9.3
+ vite@0.1.12
+ vite-plus@0.1.12
+ @base-ui/react@1.3.0
+ @fontsource-variable/inter@5.2.8
+ @phosphor-icons/react@2.1.10
+ @streamdown/code@1.1.0
+ @tailwindcss/vite@4.2.1
+ class-variance-authority@0.7.1
+ clsx@2.1.1
+ cmdk@1.1.1
+ date-fns@4.1.0
+ embla-carousel-react@8.6.0
+ input-otp@1.4.2
+ next-themes@0.4.6
+ react-day-picker@9.14.0
+ react-resizable-panels@4.7.3
+ recharts@2.15.4 (v3.8.0 available)
+ shadcn@4.0.8
+ sonner@2.0.7
+ streamdown@2.4.0
+ tailwind-merge@3.5.0
+ tailwindcss@4.2.1
+ tw-animate-css@1.4.0
+ vaul@1.1.2
611 packages installed [3.72s]
$ tsc && vp build
/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:748
    throw new Error(
          ^
Error: Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.

    at Object.<anonymous> (/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:748:11)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at cjsLoader (node:internal/modules/esm/translators:309:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25) {
  [cause]: Error: Cannot find module '@voidzero-dev/vite-plus-linux-x64-musl'
  Require stack:
  - /app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs
      at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
      ... 6 lines matching cause stack trace ...
      at require (node:internal/modules/helpers:147:16)
      at requireNative (/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:354:27)
      at Object.<anonymous> (/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:715:17) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs'
    ],
    cause: Error: Cannot find module './vite-plus.linux-x64-musl.node'
    Require stack:
    - /app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs
        at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
        at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
        at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
        at Function._load (node:internal/modules/cjs/loader:1192:37)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
        at Module.require (node:internal/modules/cjs/loader:1463:12)
        at require (node:internal/modules/helpers:147:16)
        at requireNative (/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:349:18)
        at Object.<anonymous> (/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs:715:17) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/app/src/web-chat-react/node_modules/vite-plus/binding/index.cjs'
      ]
    }
  }
}
Node.js v22.22.0
error: script "build" exited with code 1

Reproduction

https://gist.github.com/xinyao27/2326b75809373ae946092486b14899de

Steps to reproduce

No response

System Info

VITE+ - The Unified Toolchain for the Web

Environment:
  Version  24.14.0
  Source   lts

Tool Paths:
  node  /Users/chenyueban/.vite-plus/js_runtime/node/24.14.0/bin/node
  npm   /Users/chenyueban/.vite-plus/js_runtime/node/24.14.0/bin/npm
  npx   /Users/chenyueban/.vite-plus/js_runtime/node/24.14.0/bin/npx

Used Package Manager

bun

Logs

Validations

Activity

  1. added theissue type on Mar 17, 2026
  2. fengmk2 commented on Mar 17, 2026

    @fengmk2
    Member

    Does this error occur only with Bun, or does it also happen under Node.js?

  3. self-assigned this
    on Mar 17, 2026
  4. vidarc commented on Mar 17, 2026

    @vidarc

    Run into the same issue with the NodeJS alpine docker image

    FROM node:24.14.0-alpine3.22 AS builder
    
    WORKDIR /app
    
    RUN corepack enable
    
    COPY .yarn/ .yarn/
    COPY ["package.json", "yarn.lock", ".yarnrc.yml", "./"]
    
    RUN yarn install --immutable
    
    RUN yarn vp build
    
    {
    	"name": "package",
    	"type": "module",
    	"dependencies": {
    		"@fastify/middie": "9.3.1",
    		"@fastify/static": "9.0.0",
    		"@vitejs/plugin-react": "6.0.1",
    		"close-with-grace": "2.5.0",
    		"fastify": "5.8.2",
    		"react": "19.2.4",
    		"react-dom": "19.2.4"
    	},
    	"devDependencies": {
    		"@tsconfig/node-ts": "23.6.4",
    		"@tsconfig/node24": "24.0.4",
    		"@tsconfig/strictest": "2.0.8",
    		"@types/node": "24.12.0",
    		"@types/react": "19.2.14",
    		"@types/react-dom": "19.2.3",
    		"typescript": "5.9.3",
    		"vite": "npm:@voidzero-dev/vite-plus-core@0.1.11",
    		"vite-plus": "0.1.11"
    	},
    	"resolutions": {
    		"vite": "npm:@voidzero-dev/vite-plus-core@0.1.11",
    		"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.11"
    	},
    	"packageManager": "yarn@4.13.0"
    }

    Running with this, it complains about Cannot find module '@voidzero-dev/vite-plus-linux-arm64-musl'

  5. fengmk2 commented on Mar 17, 2026

    @fengmk2
    Member

    Got it, we currently don't support Linux arm64 musl operating system environment yet, I'll make a note of it.

  6. changed the issue type fromtoon Mar 17, 2026
  7. added 8 commits that reference this issue on Mar 17, 2026
    df968a6
    4ff7810
    05d77f6
    b18cfb5
    77a73b3
    ec767e6
    ed6f469
    b30e5e5
  8. xinyao27 commented on Mar 18, 2026

    @xinyao27
    Author

    > Does this error occur only with Bun, or does it also happen under Node.js?

    This also happens under Node.js

  9. 16 remaining items

  10. added a commit that references this issue on Mar 18, 2026
    2469a9b
  11. added 12 commits that reference this issue on Mar 22, 2026
    5fe7b19
    3c54fd5
    6f9e7ea
    5a14c5b
    4b49fef
    5ff07bb
    442076e
    770e5d3
    a682c8e
    f3e720c
    192c120
    1462953
  12. wawanmain22 commented on Mar 30, 2026

    @wawanmain22

    test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions