Repository navigation
Description
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:
- VitePlus should provide a fallback (e.g., WASM) when the native binding is unavailable, or
- 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/npxUsed Package Manager
bun
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Activity
fengmk2 commentedon Mar 17, 2026
Does this error occur only with Bun, or does it also happen under Node.js?
vidarc commentedon Mar 17, 2026
Run into the same issue with the NodeJS alpine docker image
{ "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'fengmk2 commentedon Mar 17, 2026
Got it, we currently don't support Linux arm64 musl operating system environment yet, I'll make a note of it.
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
xinyao27 commentedon Mar 18, 2026
> Does this error occur only with Bun, or does it also happen under Node.js?
This also happens under Node.js
16 remaining items
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: add Linux musl target support for NAPI bindings
feat: download musl Node.js from unofficial-builds on musl targets
feat: add Linux musl target support for NAPI bindings
feat: download musl Node.js from unofficial-builds on musl targets
feat: add Linux musl target support for NAPI bindings
feat: download musl Node.js from unofficial-builds on musl targets
feat: add Linux musl target support for NAPI bindings
feat: download musl Node.js from unofficial-builds on musl targets
feat: add Linux musl target support for NAPI bindings
feat: download musl Node.js from unofficial-builds on musl targets
feat: add Linux musl target support (#995)
wawanmain22 commentedon Mar 30, 2026
test