You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: lazy compilation: import() of a module that accepts its own updates keeps resolving to its first namespace #16594
With lazy compilation on (Rsbuild's dev default), a module loaded with import() that accepts its own updates evaluates again on each edit, but a later import() of it keeps resolving to the namespace of its first evaluation. With dev.lazyCompilation: false, it resolves to the new one.
// src/value.js (edited to v2, then v3)exportconstvalue='v1';(window.__evals??=[]).push('v1')if(import.meta.webpackHot){import.meta.webpackHot.accept()}setTimeout(()=>window.__show?.(),0)// import it again after each evaluation
The lazy proxy makes a new namespace promise only in its hot.accept(<id>, () => hot.invalidate()) handler (module.rs), which a module that accepts itself never reaches.
We hit this with solid-refresh, which adds import.meta.webpackHot.accept() to modules that hold components.
npm run repro: starts the Rsbuild dev server, opens the page in headless Chromium (playwright-core), edits src/value.js twice, prints what import() answers; exits 1
npm run control: same with dev.lazyCompilation: false; exits 0
Activity
fix(solid-router): a Solid split chunk imported again answers its new…