Repository navigation
fix(core): warn when a tsconfig cannot be read instead of ignoring it silently - #855
Conversation
… silently A tsconfig named by setTsconfigPath(), TS_NODE_PROJECT or OXC_TSCONFIG_PATH that does not exist or does not parse, and a discovered tsconfig that fails to load (bad JSON, a missing extends or references target), now print one warning on stderr naming the file and the reason. The run still goes on without the config, as before. Each warning is printed once per process. Closes #844 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c2b22daa7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
find_tsconfig skips a tsconfig.json it cannot open (permission denied, any I/O error) and keeps walking up without returning an error, so the warning on its error path never fired for it. Scan the ancestors below the first readable config once per directory and report each unreadable one as skipped; the nearest-ancestor fallback reports the same skip. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d804282d00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ble explicit ones The unreadable-ancestor scan stopped at the first readable config, but discovery walks past a readable config that does not claim the file, so an unreadable one above it went unreported. Stop the scan where find_tsconfig itself stopped: the directory of the config it returned or failed on, or nowhere when no config claims the file. An explicit tsconfig whose path cannot be checked (a parent directory that may not be searched) was reported as missing. Report it as unreadable with the I/O error instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d04d44fb43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A lookup that fails without naming the config it failed on, such as a missing extends or references target, stopped the unreadable-ancestor scan before it began. Scan conservatively instead, up to the first config that can be read or fails, as is already done for a config found through a project reference. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e81365407
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…aithfully find_tsconfig parses its argument as a specifier, so a path with `?`, an unescaped `#` or bytes that are not UTF-8 is walked from a truncated or lossily converted path. Scanning the real path's ancestors could then report an unreadable config the walk never reached, so skip the scan for those. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1488460e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
An explicit tsconfig that exists but cannot be loaded was still installed as the resolver's manual config, and Resolver::resolve loads that config on every call, so every resolution failed and only Node's own fallback kept plain relative imports working; `./a.js` -> `a.ts` did not resolve. Rebuild the resolver without tsconfig handling when the config fails to load, so the run really goes on without it, as the warning says. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f70df12719
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…wning configs The resolver treats a tsconfig.json whose metadata cannot be read (a symlink into a directory that may not be searched) as "not a file" and walks on; report it as skipped instead of passing over it the same way. A failed lookup stops at the first config that fails to load for a reason other than I/O, and every config below it that loads did not claim the file. Scan up to that config exactly instead of stopping at the first readable one, so an unreadable config between them is reported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb86e07c6b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…k up walk_nearest still used Path::is_file, which turns a metadata error (a symlink into a directory that may not be searched) into "not a file", so the fallback skipped such a config silently. Share the metadata check with the discovery scan, which reports it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2abff62fc0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…y errors On Windows the resolver meets the same tsconfig spelled with `/` and with `\`, so warn_once printed one broken config twice. Show warning paths with `\` only, so both spellings make the same message. The browser WASI build preopens no directory, so every metadata lookup fails there; only report a candidate whose lookup is refused (permission denied), and never on wasm, instead of taking any metadata error for a skipped config. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8481bc504f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- A tsconfig.json symlink whose target is gone is skipped by the resolver as if nothing were there; report it. - Drop the blanket wasm exemption: the Node WASI fallback preopens the host root and gets real permission errors. The browser build's missing preopen fails with ENOTCAPABLE, which is not PermissionDenied and so is already taken for "no config". - Memoize the scan only after a successful lookup, which the resolver caches; a failed one is retried by the resolver, so scan it again too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e77d3cb3bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lback rejects - Report every metadata error on a candidate except absence, a file in the way of a directory, and WASI's ENOTCAPABLE for a path outside every preopen, so a symlink cycle (ELOOP) is no longer taken for "no config". - walk_nearest rejected a malformed config with debug logging only; warn, worded as discover words it so a config both reject is reported once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 006e4ca25a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…panic on stderr - Under a directory that may not be searched, a metadata lookup fails whether or not the candidate exists, so a path the transform API is merely handed reported configs that were never there. Confirm the entry with symlink_metadata first; the symlink cases still pass that check. - eprintln! panics when stderr is closed; write the warning with writeln! and ignore a failed write, so a diagnostic cannot fail the run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Closes #844
Problem
A tsconfig that could not be used was dropped without a word. A typo in
TS_NODE_PROJECT/OXC_TSCONFIG_PATH, a trailing comma intsconfig.json, or anextendspointing at a missing file all meantpaths, decorators and other options silently stopped applying, and the only symptom was a confusing resolve or transform error later.Fix
oxc-node now prints one warning on stderr and keeps running without the config, as before:
setTsconfigPath(),TS_NODE_PROJECT,OXC_TSCONFIG_PATH): the missing case names its source. The unparseable case names the file and the parse error.skipping it, and the walk still goes on to a grandparent config.Debugoutput, sodescribe_tsconfig_errorrewrites it as<file>: <reason>.Tests
TS_NODE_PROJECTandOXC_TSCONFIG_PATH, an explicit broken file, a discovered broken file (warned once across three modules), a missingextendstarget, a missingreferencestarget, and an unreadable nested config (skipped on Windows and as root).🤖 Generated with Claude Code