Skip to content

fix(core): warn when a tsconfig cannot be read instead of ignoring it silently - #855

Merged
Brooooooklyn merged 12 commits into
mainfrom
fix/issue-844
Oct 17, 2026
Merged

Brooooooklyn merged 12 commits into
mainfrom
fix/issue-844

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

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 in tsconfig.json, or an extends pointing at a missing file all meant paths, 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:

oxc-node: warning: the tsconfig TS_NODE_PROJECT names, /app/tsconfig.prod.json, does not exist; running without a tsconfig
oxc-node: warning: failed to read the tsconfig /app/tsconfig.json: EOF while parsing an object at line 2 column 0; ignoring it
oxc-node: warning: the tsconfig /app/base.json, which a tsconfig extends or references, does not exist; ignoring it
  • Explicit configs (setTsconfigPath(), TS_NODE_PROJECT, OXC_TSCONFIG_PATH): the missing case names its source. The unparseable case names the file and the parse error.
  • Discovered configs: the load error is reported instead of being swallowed. An unreadable one (permission denied, any I/O error), which the resolver skips without an error, is reported as skipping it, and the walk still goes on to a grandparent config.
  • oxc_resolver's own message for a parse error is its Debug output, so describe_tsconfig_error rewrites it as <file>: <reason>.
  • Each distinct warning is printed once per process, so a broken config shared by many files doesn't flood stderr.

Tests

  • Rust unit test for the warning wording.
  • Integration tests: a missing TS_NODE_PROJECT and OXC_TSCONFIG_PATH, an explicit broken file, a discovered broken file (warned once across three modules), a missing extends target, a missing references target, and an unreadable nested config (skipped on Windows and as root).
  • Existing broken-config specs that asserted empty stderr now assert exactly the one warning.

🤖 Generated with Claude Code

… 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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T17:18:32.880251Z 98481da New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
- 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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
…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>
@Brooooooklyn
Brooooooklyn merged commit e826d9a into main Oct 17, 2026
67 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/issue-844 branch October 17, 2026 03:10
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.

A tsconfig that cannot be read is ignored without a warning

1 participant