feat: add ResolveError::TsconfigLoadFailed for tsconfig read and parse failures#1287
Conversation
Merging this PR will not alter performance
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | resolver_memory[multi-thread] |
243.1 µs | 253.2 µs | -4.02% |
| ❌ | resolver_real[multi-thread] |
247.6 µs | 255.5 µs | -3.1% |
| ⚡ | pm/yarn-flat |
917.9 µs | 843.1 µs | +8.87% |
| ⚡ | pm/pnpm-isolated |
1,032.4 µs | 976.6 µs | +5.72% |
| ⚡ | pm/bun-isolated |
1,028.2 µs | 993.4 µs | +3.5% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing shulaoda:07-10-feat_add_resolveerror_tsconfigloadfailed_for_tsconfig_read_and_parse_failures (6eb34df) with main (7135ac4)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
## 🤖 New release * `oxc_resolver`: 11.23.0 -> 11.24.0 * `oxc_resolver_napi`: 11.23.0 -> 11.24.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `oxc_resolver` <blockquote> ## [11.24.0](v11.23.0...v11.24.0) - 2026-07-12 ### <!-- 0 -->🚀 Features - expose tsconfig paths resolve method without file existence check ([#1282](#1282)) (by @sapphi-red) - add `ResolveError::TsconfigLoadFailed` for tsconfig read and parse failures ([#1287](#1287)) (by @shulaoda) ### <!-- 2 -->🚜 Refactor - replace cfg-if dependency with std cfg_select! macro ([#1290](#1290)) (by @Boshen) ### <!-- 3 -->📚 Documentation - normalize README sponsor section ([#1273](#1273)) (by @Boshen) ### <!-- 4 -->⚡ Performance - *(cache)* reuse the child path when its parent canonicalizes to itself ([#1288](#1288)) (by @Boshen) - *(napi)* shrink release binaries (path remap + build-std without backtrace) ([#1283](#1283)) (by @Boshen) ### Contributors * @sapphi-red * @Boshen * @renovate[bot] * @shulaoda </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
## 🤖 New release * `oxc_resolver`: 11.24.0 -> 11.24.1 * `oxc_resolver_napi`: 11.24.0 -> 11.24.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `oxc_resolver` <blockquote> ## [11.24.0](v11.23.0...v11.24.0) - 2026-07-12 ### <!-- 0 -->🚀 Features - expose tsconfig paths resolve method without file existence check ([#1282](#1282)) (by @sapphi-red) - add `ResolveError::TsconfigLoadFailed` for tsconfig read and parse failures ([#1287](#1287)) (by @shulaoda) ### <!-- 2 -->🚜 Refactor - replace cfg-if dependency with std cfg_select! macro ([#1290](#1290)) (by @Boshen) ### <!-- 3 -->📚 Documentation - normalize README sponsor section ([#1273](#1273)) (by @Boshen) ### <!-- 4 -->⚡ Performance - *(cache)* reuse the child path when its parent canonicalizes to itself ([#1288](#1288)) (by @Boshen) - *(napi)* shrink release binaries (path remap + build-std without backtrace) ([#1283](#1283)) (by @Boshen) ### Contributors * @sapphi-red * @Boshen * @renovate[bot] * @shulaoda </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
Tsconfig files are loaded lazily during resolution, and when the load fails with anything other than "not found", the error surfaces as the generic
ResolveError::JsonorResolveError::IOError. Both variants are also used for package.json failures, so callers cannot tell which file actually failed to load. Rolldown hit this while trying to report a broken tsconfig as a properTSCONFIG_ERRORdiagnostic instead of an internal error, see the discussion in rolldown/rolldown#10200 (rolldown/rolldown#10200 (comment)).This PR adds a dedicated variant that wraps the original error instead of replacing it, so the JSON details (path, line, column) stay reachable through
source:The wrapping happens in
Cache::get_tsconfig, the single entry point for tsconfig loading, so manual mode, auto discovery, theextendschain and project references are all covered at once.TsconfigNotFoundkeeps its dedicated variant, and package.json failures keep surfacing as plainJson/IOError. The auto discovery walk used to skip unreadable tsconfig files by matchingIOErrordirectly and now matches the wrapped form, keeping the same behavior.Since
ResolveErroris#[non_exhaustive], adding the variant is not a breaking change for downstream matches. The existingbroken,test_extend_tsconfig_unreadable_fileandtest_references_unreadable_filetests are updated to assert the new shape.