-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
I tried to upgrade https://github.com/jakebailey/esbuild-playground to vite v6, but hit an issue with a CJS library I use in a worker. It looks like vite (or rollup?) can't find one of the exports, while vite v5 can.
Notably, doing the same import but not in a worker seems to operate correctly. It also works fine in dev mode.
I've created a minimal repro on stackblitz, included below, along with logs that are just in that stackblitz.
Reproduction
https://stackblitz.com/edit/vitejs-vite-cc7pyv?file=src%2Fmain.ts&view=editor
Steps to reproduce
npm installnpm run build
System Info
System:
OS: Linux 6.11 Arch Linux
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 10.12 GB / 15.41 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.10.0 - /run/user/1000/fnm_multishells/582535_1732647819061/bin/node
pnpm: 9.12.2 - /run/user/1000/fnm_multishells/582535_1732647819061/bin/pnpm
bun: 1.1.37 - /usr/bin/bun
npmPackages:
@vitejs/plugin-react: ^4.3.3 => 4.3.3
vite: ^5.4.10 => 5.4.10Used Package Manager
npm
Logs
Click to expand!
> vite-typescript-starter@0.0.0 build
> tsc && vite build
vite v6.0.0 building for production...
✓ 7 modules transformed.
x Build failed in 752ms
error during build:
[vite:worker] src/worker.ts (1:9): "createFileSystem" is not exported by "node_modules/wasi-js/dist/index.js", imported by "src/worker.ts".
file: /home/projects/vitejs-vite-cc7pyv/src/worker.ts?worker:1:9
1: import { createFileSystem } from 'wasi-js';
^
2:
3: createFileSystem([
at getRollupError (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/parseAst.js:558:41)
at Module.error (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/parseAst.js:554:42)
at Module.error (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:15618:29)
at Module.traceVariable (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:16067:29)
at ModuleScope.findVariable (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:13850:39)
at Identifier.bind (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:5096:40)
at CallExpression.bind (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:2683:23)
at CallExpression.bind (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:11314:15)
at ExpressionStatement.bind (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:2683:23)
at Program.bind (file:///home/projects/vitejs-vite-cc7pyv/node_modules/rollup/dist/es/shared/node-entry.js:2679:28)Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release