forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Description
When using rolldown-vite for production SSR/SSG builds in a complex React framework (One), components become undefined during static page generation, causing React error #130.
Reproduction
Repository: https://github.com/onejs/one
Branch: rolldown-web-support
git clone https://github.com/onejs/one.git
cd one
git checkout rolldown-web-support
yarn install
cd tests/test
yarn test:with-rolldown:prod # Fails with React #130
yarn test:with-rolldown:dev # Works fine (62 tests pass)Error
Error: Minified React error #130; visit https://react.dev/errors/130?args[]=undefined&args[]=
at renderElement (file:///...dist/server/assets/server.browser-DN7apeF3.js:6198:10)
This error means: "Element type is invalid: expected a string or class/function but got: undefined"
Analysis
The issue appears related to rolldown's lazy module initialization pattern:
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var Text_default;
var init_Text = __esmMin(() => {
Text_default = Text$1;
});When chunks import Text_default from the entry:
- The import happens
init_dist()is called which callsinit_Text()- But by the time the chunk uses
Text_default, it's still undefined
This seems to violate ES module live binding semantics where imports should reflect the current value of exports.
What Works
- Dev mode: All tests pass
- Manual testing: Loading modules directly in Node.js works fine
What Doesn't Work
- Production SSG: Fails when rendering routes that use components re-exported through the virtual entry
Attempted Fixes
experimental.strictExecutionOrder: true- No effect on outputinlineDynamicImports: true- Did not resolveminify: false- Error still occurs
Environment
- rolldown-vite: 7.3.0
- Node.js: 24.x
- Platform: macOS Darwin
Related
- Exclude entry files vite#2655 in rolldown/rolldown (strictExecutionOrder issues)
- https://rolldown.rs/guide/in-depth/code-splitting