forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
Description
Describe the bug
vite@8.0.0-beta.13 (rolldown 1.0.0-rc.3) introduced a regression where optimizeDeps produces chunks with circular imports that cause runtime errors. Works fine on 8.0.0-beta.11 (rolldown 1.0.0-rc.2).
Expected behavior
Chunks produced by optimizeDeps should not have circular imports that break top-level initialization, or the shared chunk should contain the entry chunk's code to avoid the cycle.
Browser console:
Uncaught TypeError: Cannot read properties of undefined (reading 'MappedStatic')
at getSecondaryStructureParams (molstar_lib_mol-model-props_computed_secondary-structure__js.js:10:33)
The optimized output has this circular structure:
zhang-skolnik-*.js (shared) ──imports──> secondary-structure.js (entry)
^ │
└──────────────imports─────────────────────┘
Workaround doesn't work, causes cascading CJS issues
optimizeDeps: {
exclude: ["molstar"],
}
Reproduction
https://stackblitz.com/edit/vitejs-vite-3yh26fyo?file=vite.config.ts
Steps to reproduce
No response
System Info
System:
OS: Linux 5.15 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
Memory: 10.02 GB / 31.19 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 24.3.0 - /run/user/1000/fnm_multishells/715052_1770846790025/bin/node
npm: 11.8.0 - /run/user/1000/fnm_multishells/715052_1770846790025/bin/npm
pnpm: 9.12.3 - /home/yakov/.local/share/pnpm/pnpm
Browsers:
Chrome: 144.0.7559.132
npmPackages:
@vitejs/plugin-react: ^5.1.3 => 5.1.3Used Package Manager
npm
Logs
No response
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.
Reactions are currently unavailable