Skip to content

Comments

fix: handle tsconfig.json load errors#8105

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-28-fix_handle_tsconfig.json_load_errors
Jan 28, 2026
Merged

fix: handle tsconfig.json load errors#8105
graphite-app[bot] merged 1 commit intomainfrom
01-28-fix_handle_tsconfig.json_load_errors

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Jan 28, 2026

The error is expected and should not be UNHANDLEABLE_ERROR

fixes #8097

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.

@sapphi-red sapphi-red marked this pull request as ready for review January 28, 2026 12:18
Copilot AI review requested due to automatic review settings January 28, 2026 12:18
@netlify
Copy link

netlify bot commented Jan 28, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit c29fd5a
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/697a083ff60e4d0008af89fd

@sapphi-red sapphi-red marked this pull request as draft January 28, 2026 12: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

This PR fixes issue #8097 where tsconfig.json loading errors were causing builds to fail in GitHub Actions with unclear error messages. The fix improves error handling by converting tsconfig resolution errors into properly formatted BuildDiagnostic messages.

Changes:

  • Moved resolve_error_to_message utility function from rolldown_resolver to rolldown_error crate for better organization
  • Added new TsConfigError event type with clear, user-friendly error messages
  • Updated error handling in transform_options.rs to use BuildDiagnostic instead of anyhow errors
  • Added comprehensive test case for tsconfig parsing errors

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/rolldown_resolver/src/lib.rs Removed error module export as functionality moved to rolldown_error
crates/rolldown_error/src/utils/resolve_error.rs New utility function to convert oxc ResolveError to user-friendly messages
crates/rolldown_error/src/utils/mod.rs Export resolve_error_to_message utility
crates/rolldown_error/src/types/event_kind.rs Added TsConfigError event kind
crates/rolldown_error/src/lib.rs Public export of resolve_error_to_message
crates/rolldown_error/src/build_diagnostic/events/tsconfig_error.rs New TsConfigError event with formatted error messages
crates/rolldown_error/src/build_diagnostic/events/mod.rs Module declaration for tsconfig_error
crates/rolldown_error/src/build_diagnostic/constructors.rs Constructor for TsConfigError diagnostic
crates/rolldown_common/src/inner_bundler_options/types/transform_options.rs Updated to use BuildDiagnostic for tsconfig errors instead of anyhow
crates/rolldown/src/module_loader/resolve_utils.rs Updated import path for resolve_error_to_message
crates/rolldown/tests/rolldown/errors/tsconfig_error/* Test case with invalid JSON in tsconfig to verify error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sapphi-red sapphi-red force-pushed the 01-28-fix_handle_tsconfig.json_load_errors branch from 31b6e7c to 5c8b6de Compare January 28, 2026 12:21
@sapphi-red sapphi-red marked this pull request as ready for review January 28, 2026 12:23
Copilot AI review requested due to automatic review settings January 28, 2026 12:23
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 13 out of 15 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

Benchmarks Rust

  • target: main(d4a32e9)
  • pr: 01-28-fix_handle_tsconfig.json_load_errors(5c8b6de)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.02     65.6±1.01ms        ? ?/sec    1.00     64.6±0.99ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     71.3±1.00ms        ? ?/sec    1.00     70.8±1.27ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00     98.4±2.44ms        ? ?/sec    1.01     99.0±3.46ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    109.3±1.44ms        ? ?/sec    1.02    111.2±2.14ms        ? ?/sec
bundle/bundle@threejs                                        1.01     34.9±2.37ms        ? ?/sec    1.00     34.5±0.76ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     39.1±0.48ms        ? ?/sec    1.04     40.6±1.82ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    356.9±3.12ms        ? ?/sec    1.01    361.2±6.34ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    413.3±2.62ms        ? ?/sec    1.01    418.7±3.80ms        ? ?/sec
scan/scan@rome_ts                                            1.00     77.6±1.41ms        ? ?/sec    1.02     79.5±1.93ms        ? ?/sec
scan/scan@threejs                                            1.00     26.9±0.31ms        ? ?/sec    1.03     27.6±1.64ms        ? ?/sec
scan/scan@threejs10x                                         1.00    280.8±4.03ms        ? ?/sec    1.00    280.8±4.02ms        ? ?/sec

Copy link
Member

hyf0 commented Jan 28, 2026

Merge activity

  • Jan 28, 12:59 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 28, 12:59 PM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Jan 28, 1:10 PM UTC: Merged by the Graphite merge queue.

The error is expected and should not be UNHANDLEABLE_ERROR

fixes #8097
@graphite-app graphite-app bot force-pushed the 01-28-fix_handle_tsconfig.json_load_errors branch from 5c8b6de to c29fd5a Compare January 28, 2026 12:59
@graphite-app graphite-app bot merged commit c29fd5a into main Jan 28, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 01-28-fix_handle_tsconfig.json_load_errors branch January 28, 2026 13:10
@github-actions github-actions bot mentioned this pull request Jan 28, 2026
shulaoda added a commit that referenced this pull request Jan 28, 2026
## [1.0.0-rc.2] - 2026-01-28

⚡ Lazy Barrel Optimization

- Skips compilation of unused re-export modules in side-effect-free barrel modules
- Particularly beneficial for projects importing from large component libraries

For large component libraries like Ant Design, when you import just one component:

```js
import { Button } from 'antd';
Button;
```

| Metric                    | Without lazy barrel | With lazy barrel |
| -------------------- | --------------------- | ---------------- |
| Modules compiled | 2986                       | 250              |
| Build time               | ~210ms                  | ~50ms            |

By enabling lazy barrel, Rolldown reduces the number of compiled modules by 90% and speeds up the build by 2-4x. 

Enable it in your config:

```js
export default {
  experimental: {
    lazyBarrel: true,
  },
};
```

For more details, see the https://rolldown.rs/in-depth/lazy-barrel-optimization

### 💥 BREAKING CHANGES

- expose `\0rolldown/runtime` in transform hook (#8068) by @hyf0
- rename `rolldown:runtime` to `\0rolldown/runtime.js` (#8067) by @hyf0

### 🚀 Features

- remove inlined constants in smart mode (#8085) by @sapphi-red
- allow more options for `this.emitFile` with `type: 'prebuilt-chunk'` (#8062) by @sapphi-red
- warn when both code and postBanner contain shebang (#8039) by @Copilot

### 🐛 Bug Fixes

- update the links to Rolldown docs in the error messages (#8103) by @sapphi-red
- handle tsconfig.json load errors (#8105) by @sapphi-red
- include inlined constants in namespace object (#8099) by @sapphi-red
- vite test ci (#8084) by @IWANABETHATGUY
- renamer: nested binding shadowing external module namespace in UMD/IIFE formats (#8083) by @Dunqing
- deduplicate ESM chunk imports by canonical symbol (#8059) by @IWANABETHATGUY
- refine side-effect detection for BigInt and RegExp (#8060) by @IWANABETHATGUY
- rust: use string literal span for `new URL` error diagnostic (#8043) by @valadaptive
- rust: use ModuleType::Asset for `new URL` imports (#8035) by @valadaptive
- CJS-ESM interop - property assignment on CJS module exports (#8006) by @IWANABETHATGUY
- eliminate the facade chunk if the dynamic entry module has been merged into common chunk (#8046) by @IWANABETHATGUY
- Inlining dynamic imports broken with multiple entry points (#8037) by @IWANABETHATGUY
- devtools: revert `Chunk#id` to `Chunk#chunk_id` (#8040) by @hyf0
- invert `__exportAll` parameter logic to reduce default output size (#8036) by @Copilot
- `</script` tag search should be case insensitive (#8033) by @IWANABETHATGUY
- use directory name as-is for the variable name even if the name contained `.` (#8029) by @Copilot
- dev/lazy: remove unnecessary rewrite from top level `this` to `undefined` (#8020) by @hyf0
- dev/lazy: should keep lazy entries imports for patch file (#8019) by @hyf0
- `output.generatedCode.preset: 'es2015'` was not set by default (#8026) by @sapphi-red
- node: align option validator to types (#8023) by @sapphi-red
- node: allow `output.strictExecutionOrder` by the option validator (#8022) by @sapphi-red
- types: return `this` from on / off methods of `RolldownWatcher` (#8015) by @sapphi-red

### 🚜 Refactor

- rolldown_plugin_vite_dynamic_import_vars: remove v1 implementation (#8096) by @shulaoda
- rolldown_plugin_vite_import_glob: remove v1 implementation (#8095) by @shulaoda
- lazy-barrel: restructure lazy barrel implementation (#8070) by @shulaoda
- remove `use_built_ins` and `use_spread` from internal JSX options (#8079) by @sapphi-red
- remove `experimental.transformHiresSourcemap` (#8055) by @Copilot
- rust: use `is_data_url` more consistently (#8042) by @valadaptive
- use `FxIndexMap` to store EntryPoint (#8032) by @IWANABETHATGUY
- node: add type checks that ensures validator schema is up to date with types (#8024) by @sapphi-red

### 📚 Documentation

- link to vite plugin registry (#8086) by @sapphi-red
- lazy-barrel: improve documentation and enable in sidebar (#8072) by @shulaoda
- add more examples and details (#8054) by @sapphi-red
- in-depth: add dead code elimination page (#8007) by @sapphi-red
- update status from beta to release candidate (#8012) by @shulaoda

### ⚡ Performance

- run inline-const pass for modules that are affected by inlining (#8064) by @sapphi-red

### 🧪 Testing

- lazy-barrel: use package.json sideEffects instead of plugin hook (#8077) by @shulaoda
- lazy-barrel: enable tests and add treeshake-behavior cases (#8071) by @shulaoda

### ⚙️ Miscellaneous Tasks

- deps: update crate-ci/typos action to v1.42.3 (#8087) by @renovate[bot]
- deps: update rollup submodule for tests to v4.56.0 (#8073) by @sapphi-red
- deps: update oxc to v0.111.0 (#8063) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.6 (#8076) by @renovate[bot]
- deps: update test262 submodule for tests (#8074) by @sapphi-red
- deps: update crate-ci/typos action to v1.42.2 (#8069) by @renovate[bot]
- deps: update oxc apps (#8066) by @renovate[bot]
- remove `{@include ./foo.md}` from d.ts files (#8056) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.11.2 (#8057) by @renovate[bot]
- deps: update github-actions (#8050) by @renovate[bot]
- deps: update npm packages (#8051) by @renovate[bot]
- deps: update rust crates (#8049) by @renovate[bot]
- debug: add IdxExt debug trait for human-readable index debugging (#8045) by @IWANABETHATGUY
- deps: update dependency rolldown-plugin-dts to v0.21.5 (#8034) by @renovate[bot]
- deps: update oxc resolver to v11.16.4 (#8031) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.4 (#8030) by @renovate[bot]
- deps: update dependency rust to v1.93.0 (#8018) by @renovate[bot]
- archive 2025 beta changelog (#8014) by @shulaoda
- update release workflow version pattern from beta to rc (#8013) by @shulaoda

### ❤️ New Contributors

* @valadaptive made their first contribution in [#8043](#8043)

Co-authored-by: shulaoda <[email protected]>
graphite-app bot pushed a commit that referenced this pull request Jan 29, 2026
This PR moves the JSON path extraction logic to `resolve_error_to_message` as requested by @sapphi-red. The function now requires a `DiagnosticOptions` parameter for path stabilization.

## Summary

### Changes
1. `resolve_error_to_message` now takes a required `&DiagnosticOptions` parameter
2. `ResolveError::Json` includes the file path in the error message
3. All call sites create and pass `DiagnosticOptions` with `cwd` for path stabilization
4. Updated snapshots for package.json syntax error tests

### Before
```
[TSCONFIG_ERROR] Error: Failed to load tsconfig for 'main.ts': JSON parse error
```

### After
```
[TSCONFIG_ERROR] Error: Failed to load tsconfig for 'main.ts': JSON parse error in 'tsconfig.json'
```

<!-- START COPILOT CODING AGENT SUFFIX -->

<!-- START COPILOT ORIGINAL PROMPT -->

<details>

<summary>Original prompt</summary>

> Read #8105 (comment) and try it

</details>

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/rolldown/rolldown/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
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]: Could not resolve 'node:module' in rolldown:runtime (in GitHub Actions)

2 participants