Skip to content

[Bug]: onDemandWrapping emits circular init_* calls before initialization #10265

Description

@marvinhagemeister

Reproduction link or steps

https://repl.rolldown.rs/#eNqNUk1PwzAM/StWDnSTpu5ehBCD/8Cll7R1t0DrltSFoan/HTtt2ScSUg6xHb/3/JyDKU1yMI4K3Mfc6Z1McoxXJtewbhvPcNgiPw1Q+qaGKF7b+K2L7lPy+NE7j4s5tZRcSrgPPXlDHYPHrq8YHkARFst7wUWTsO9xWBnfVFXRfFEsb0u3PZFxo3IuCAosHeFzKMMsbW6LTnTIQ6sSThsWh5QAHLU9JzBCxjWyjUNqBes18A6hdBV20GGFOWMB2XfIZj1zQyAHbb4DtpmCSUvTspOhNRJu9K5GYlslENhAOl6wtlS8etu2jrYJqA9aG1IalikZ8aS1+bvdotjZiBGjG2e50YcAmZoCW5SNUe6wS40wKdIIpBuZAcL9aqOb40azaaNztUJbHqsaTQ9+bS17ynXcabHjjB659yG1gbs70D54hMhGkEDUy38Rw2xWoSINKlJ5Z5Hh/p9vd1PD5lrDk3Jnf3JPU830czgquGTQ6gVDpLkJTeA+FcMydmyGH6ZOIOY=

What is expected?

No error during evaluation

What is actually happening?

TypeError: init_a is not a function

System Info

rolldown 1.1.5

Any additional comments?

This resembles #7449 at the symptom level, but does not require code splitting or a cross-chunk cycle. The reproduction emits a single chunk, and the undefined function is a Rolldown-generated init_* wrapper called before its later var init_* = __esmMin(...) assignment.

It is also distinct from #9946, which is specific to Vite bundledDev and emits a source-level cyclic import as an entirely unbound identifier.

#10008 tracks chunking-caused issues, while this failure occurs without multiple output chunks.

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions