Skip to content

[Bug]: Panic with "jsx": "preserve" #6036

@ocavue

Description

@ocavue

Reproduction link or steps

https://github.com/issueset/rolldown-issue-6036

$ git clone https://github.com/issueset/rolldown-issue-6036
$ cd rolldown-issue-6036
$ pnpm install 
$ pnpm run build:rolldown

What is expected?

No error occurs, like what esbuild does:

$ pnpm run build:esbuild

> [email protected] build:esbuild /private/tmp/5
> esbuild src/index.ts --bundle --tsconfig=tsconfig.json --outdir=dist/esbuild


  dist/esbuild/index.js  46.1kb

⚡ Done in 17ms

OR, if "jsx": "preserve" in tsconfig.json is something not supported by rolldown, a friendly error message for users.

What is actually happening?

Panic error

$ pnpm run build:rolldown

> [email protected] build:rolldown /private/tmp/5
> rolldown -c rolldown.config.ts


thread '<unnamed>' panicked at crates/rolldown/src/module_finalizers/impl_visit_mut.rs:506:17:
internal error: entered unreachable code: Should always rewrite to Identifier for JsxMemberExpression::get_identifier()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

 ERROR  internal error: entered unreachable code: Should always rewrite to Identifier for JsxMemberExpression::get_identifier()

System Info

System:
    OS: macOS 15.6.1
    CPU: (8) arm64 Apple M2
    Memory: 167.27 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.3 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
    pnpm: 10.11.0 - /opt/homebrew/bin/pnpm
    bun: 1.2.15 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 140.0.7339.81
    Safari: 18.6
    Safari Technology Preview: 26.0
  npmPackages:
    rolldown: 1.0.0-beta.35 => 1.0.0-beta.35

Any additional comments?

If I comment out "jsx": "preserve" in tsconfig.json, then the error goes away.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions