Skip to content

fix: avoid panic on untranspiled JSX syntax by reporting a diagnostic error#8226

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-07-fix_8216
Feb 8, 2026
Merged

fix: avoid panic on untranspiled JSX syntax by reporting a diagnostic error#8226
graphite-app[bot] merged 1 commit intomainfrom
02-07-fix_8216

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Feb 7, 2026

Closed #8216

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 2644d57
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6986c5acd0717900087788d6

@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 20bbcbc
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6988b4a05437e7000806f382

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-fix_8216 branch 4 times, most recently from b418422 to 7aae85c Compare February 8, 2026 06:12
@IWANABETHATGUY IWANABETHATGUY changed the title fix: 8216 feat: detect and report untranspiled TypeScript and JSX syntax Feb 8, 2026
@IWANABETHATGUY IWANABETHATGUY changed the title feat: detect and report untranspiled TypeScript and JSX syntax fix: avoid panic on untranspiled JSX syntax by reporting a diagnostic error Feb 8, 2026
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review February 8, 2026 07:47
Copilot AI review requested due to automatic review settings February 8, 2026 07:47
@IWANABETHATGUY IWANABETHATGUY marked this pull request as draft February 8, 2026 07:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a crash when rolldown’s AST scanning encounters untranspiled JSX/TS syntax (e.g. during SSR dep scanning) by turning previous unreachable!() paths into a conservative “has side effects” result and emitting a dedicated diagnostic instead.

Changes:

  • Introduces UNTRANSPILED_SYNTAX diagnostic kind/event and constructor plumbing in rolldown_error.
  • Tracks untranspiled JSX/TypeScript syntax during scanning/side-effect detection and reports it instead of panicking.
  • Adds an integration fixture for issue #8216 to assert the diagnostic behavior.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rolldown_error/src/types/event_kind.rs Adds UntranspiledSyntaxError event kind and display string.
crates/rolldown_error/src/generated/event_kind_switcher.rs Extends the generated event kind switcher bitflag for the new event.
crates/rolldown_error/src/build_diagnostic/events/untranspiled_syntax.rs Adds a new build event producing the untranspiled syntax diagnostic message.
crates/rolldown_error/src/build_diagnostic/events/mod.rs Registers the new untranspiled_syntax event module.
crates/rolldown_error/src/build_diagnostic/constructors.rs Adds BuildDiagnostic::untranspiled_syntax(...) constructor.
crates/rolldown_common/src/inner_bundler_options/types/transform_option/mod.rs Adds a debug-only jsx_preset override to transform options (test-focused).
crates/rolldown_common/src/inner_bundler_options/mod.rs Adds debug-only deserialization for transform.jsxPreset.
crates/rolldown_binding/src/utils/normalize_binding_transform_options.rs Aligns binding-side option normalization with the debug-only jsx_preset field.
crates/rolldown/tests/rolldown/issues/8216/main.jsx Adds fixture input containing JSX.
crates/rolldown/tests/rolldown/issues/8216/artifacts.snap Adds snapshot asserting UNTRANSPILED_SYNTAX error output.
crates/rolldown/tests/rolldown/issues/8216/_config.json Adds fixture config to reproduce untranspiled JSX detection.
crates/rolldown/src/utils/tweak_ast_for_scanning.rs Removes a TS-related unreachable!() in AST preprocessing.
crates/rolldown/src/utils/prepare_build_context.rs Allows debug-only override of derived JSX preset in build context prep.
crates/rolldown/src/stages/link_stage/cross_module_optimization.rs Propagates untranspiled-syntax tracking from side-effect detection and reports diagnostics in link stage.
crates/rolldown/src/ast_scanner/side_effect_detector/mod.rs Replaces JSX/TS unreachable!()s with conservative behavior + untranspiled-syntax tracking.
crates/rolldown/src/ast_scanner/mod.rs Tracks untranspiled TypeScript syntax in scanner instead of panicking.
crates/rolldown/src/ast_scanner/impl_visit.rs Accumulates untranspiled syntax during AST traversal and emits diagnostics after scanning.

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-fix_8216 branch 5 times, most recently from e72303c to 12e163a Compare February 8, 2026 14:19
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review February 8, 2026 14:20
Copilot AI review requested due to automatic review settings February 8, 2026 14:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Benchmarks Rust

group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     67.2±1.94ms        ? ?/sec    1.04     70.1±1.80ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     73.2±1.96ms        ? ?/sec    1.05     76.9±2.48ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00     99.5±2.03ms        ? ?/sec    1.01    100.7±2.15ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    110.7±2.31ms        ? ?/sec    1.02    112.4±1.75ms        ? ?/sec
bundle/bundle@threejs                                        1.00     35.8±2.15ms        ? ?/sec    1.01     36.1±2.07ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     39.9±0.54ms        ? ?/sec    1.02     40.9±0.84ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    365.0±5.82ms        ? ?/sec    1.01    368.2±4.72ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    418.7±9.48ms        ? ?/sec    1.02    425.4±5.65ms        ? ?/sec
scan/scan@rome_ts                                            1.00     79.4±1.57ms        ? ?/sec    1.01     79.8±1.62ms        ? ?/sec
scan/scan@threejs                                            1.00     28.0±1.64ms        ? ?/sec    1.01     28.3±1.83ms        ? ?/sec
scan/scan@threejs10x                                         1.00    282.4±4.13ms        ? ?/sec    1.03    290.0±6.97ms        ? ?/sec

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 8, 2026

Merge activity

Copilot AI review requested due to automatic review settings February 8, 2026 16:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@graphite-app graphite-app bot merged commit 20bbcbc into main Feb 8, 2026
35 checks passed
@graphite-app graphite-app bot deleted the 02-07-fix_8216 branch February 8, 2026 16:19
This was referenced Feb 11, 2026
shulaoda added a commit that referenced this pull request Feb 11, 2026
## [1.0.0-rc.4] - 2026-02-11

💡 Granular `comments` Option
- New `output.comments` option provides fine-grained control over comment preservation
- The `output.legalComments` option is now deprecated and use `comments.legal` instead

### 🚀 Features

- rename error name to `RolldownError` from `RollupError` (#8262) by @sapphi-red
- add hidden `resolve_tsconfig` function for Vite (#8257) by @sapphi-red
- rust: introduce `rolldown_watcher` (#8161) by @hyf0
- unify `comments` and `legalComments` into a single granular `comments` option (#8229) by @IWANABETHATGUY
- add builtin plugin for visualizing chunk graph (#8162) by @IWANABETHATGUY
- show import declaration location in AssignToImport errors (#8222) by @Copilot
- show import declaration span in CannotCallNamespace error (#8223) by @Copilot
- emit error when plugin accidentally removes runtime module symbols (#8203) by @IWANABETHATGUY
- support tsconfig loading & inputMap for `transform` (#8180) by @sapphi-red
- rolldown_plugin_vite_reporter: update warning message to link to Rolldown docs (#8205) by @sapphi-red

### 🐛 Bug Fixes

- avoid panic on untranspiled JSX syntax by reporting a diagnostic error (#8226) by @IWANABETHATGUY
- rolldown_plugin_vite_import_glob: relax absolute path check and improve invalid glob warning (#8219) by @shulaoda
- merge chunks after detect circular reference (#8154) by @IWANABETHATGUY
- rust: detect runtime module side effects based on its content (#8209) by @hyf0

### 🚜 Refactor

- rename `other` to `jsdoc` in comments options (#8256) by @IWANABETHATGUY
- rename chunk-visualize plugin with bundle-analyzer plugin (#8255) by @IWANABETHATGUY
- remove EXPORT_UNDEFINED_VARIABLE error (#8228) by @Copilot
- consolidate missing runtime symbol errors into a single diagnostic (#8220) by @IWANABETHATGUY
- stabilize `parse` and `parseSync` (#8215) by @sapphi-red
- return errors instead of panicking on builtin plugin conversion failure (#8217) by @shulaoda
- expose `parse` / `minify` / `transform` from `rolldown/utils` (#8214) by @sapphi-red
- prepare defer chunk merging (#8153) by @IWANABETHATGUY

### 📚 Documentation

- remove `<script>` escape behavior difference note from `platform` option (#8253) by @sapphi-red
- TypeScript & JSX support by plugins (#8183) by @sapphi-red

### 🧪 Testing

- ensure runtime module is preserved even if it's not used but has side effects (#8213) by @hyf0

### ⚙️ Miscellaneous Tasks

- deps: update oxc to v0.113.0 (#8267) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.12.0 (#8272) by @renovate[bot]
- deps: update oxc apps (#8269) by @renovate[bot]
- deps: update test262 submodule for tests (#8261) by @sapphi-red
- deps: update crate-ci/typos action to v1.43.4 (#8260) by @renovate[bot]
- deps: update dependency esbuild to v0.27.3 (#8250) by @renovate[bot]
- deps: update rust crates (#8244) by @renovate[bot]
- deps: update dependency semver to v7.7.4 (#8247) by @renovate[bot]
- deps: update github-actions (#8243) by @renovate[bot]
- deps: update npm packages (#8245) by @renovate[bot]
- deps: update oxc resolver to v11.17.1 (#8240) by @renovate[bot]
- deps: update rust crate oxc_sourcemap to v6.0.2 (#8241) by @renovate[bot]
- rust: handle ignored `RUSTSEC-2025-0141` cargo check error (#8235) by @hyf0
- deps: update dependency oxlint-tsgolint to v0.11.5 (#8233) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.22.0 (#8232) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.3 (#8225) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.9 (#8224) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.2 (#8212) by @renovate[bot]
- remove rolldown_plugin_vite_wasm_helper (#8207) by @shulaoda
- build docs for production (#8206) by @sapphi-red

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Panic in side_effect_detector: "jsx should be transpiled" when @content-collections/vite plugin triggers SSR dep scan

3 participants