Skip to content

[Bug]: json bundling error for dynamic import with .default access #6881

@NamesMT

Description

@NamesMT

Reproduction link or steps

https://repl.rolldown.rs/#eNptUMFqwzAM/RWhS1II3t2Qnccug519MY3TejhycJS1w/jfZzdOO1gPBktP7+k9RRxRRrQ0mKvgpfwJ5aPu8JjLo6eFgc3C74sn6EFftGWw0+wDt414KZD4ylhzEHw21AboXyGIwYx6dXxQQVF5Rcg7I5w/tXHXS3fYXIsgxJT3GpQcVpM6DN65wV9IZPZoT39sPkE2w5sz4J/ZQITPOvYxs80GIMEY/ATNTm/y9ps1hk1I/qP0EBUBWJpXljW4mAxrcWt1ilIRqQFq7KqmCHOK+4l284/G5jmWCwAoPBvnvEKZv2/eaYUFSJiyyHeec7owMf0CBOybyg==

What is expected?

Bundled file can be run

What is actually happening?

Bundled file is invalid due to invalid hello export in chunked file.

System Info

Any

Any additional comments?

As of the current extensive testing with beta.47, this bug seems to only happen strictly with r.default access dynamic import, it does not happen to top-level import { default as x } and other top-level/dynamic import access pattern like access r directly, or r.hello, etc.
This bug first appeared in beta.44 with the json tree-shake feat.

FYI: Why not just use r without .default, it works normally:
For some runtime, .default is required.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions