-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Incorrect chunking when code has top-level await #4708
Copy link
Copy link
Closed
Labels
Description
Rollup Version
3.2.5 (also happens in v2)
Operating System (or Browser)
macos
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
The framework.js file should have it's own build chunk in the output, and module_1-ae086170.js imports from that chunk instead, because of the top-level await in main-3d8a8f11.js
Actual Behaviour
module_1-ae086170.js imports a function from framework.js through main-3d8a8f11.js (inlined). This has problems because main-3d8a8f11.js contains top-level awaits that in turn waits for module_1-ae086170.js (loop).
Running the output in nodejs silently fails (node 22 starts logging a warning). Here's a stackblitz of the REPL's output copied. Run node test.js in the terminal to see nothing printed in the console.
Reactions are currently unavailable