Back to all fixes
CuratedTypeScriptVite 8local
TypeError: X is not a function at runtime after upgrading rolldown from 1.0.0 to 1.0.1
Problem
Production build throws errors like `TypeError: c is not a function` or `TypeError: ae is not a function` on values imported from bundled modules, after bumping vite/rolldown past 1.0.0. Root cause: a chunk-optimization change (between PR #9270 and #9305) introduced cyclic chunk imports in large module graphs, so a CJS-interop wrapper variable is read while still in a TDZ-like uninitialized state.
Solution
typescript
Workaround: pin rolldown back to the last known-good version via a package manager override, e.g. in package.json: `"overrides": { "rolldown": "1.0.0" }` (works for npm/pnpm; use `resolutions` for yarn). Do this instead of downgrading the whole `vite` package. A partial fix (PR #9466) addresses one specific shape (a CJS-facade/wrapped-ESM module shared between a static entry and dynamic-entry chunks, notable under Cloudflare Workers/SSR), but was not confirmed to resolve every reported case — the version-pin override is the reliably confirmed workaround.