Skip to content

fix(tsconfig): name the OS error when the tsconfig file cannot be read - #899

Open
colinhacks wants to merge 1 commit into
mainfrom
tsconfig-read-cause
Open

fix(tsconfig): name the OS error when the tsconfig file cannot be read#899
colinhacks wants to merge 1 commit into
mainfrom
tsconfig-read-cause

Conversation

@colinhacks

Copy link
Copy Markdown
Contributor

An unreadable tsconfig produced the same line as a missing one, and the verdict under it then told the reader to fix a config that was fine. Seen when a macOS terminal lost TCC access to ~/Documents for a few minutes: every nub <file> in a project there stopped on the tsconfig line with nothing pointing at the OS.

The read diagnostic now carries the OS error, as the parse diagnostics on the same path already do.

$ nub main.ts
Nub: Cannot resolve tsconfig at path: /Users/colinmcd94/tmp/app/tsconfig.json: Permission denied (os error 13)
Error: the project's tsconfig.json could not be read in full (see above).
Fix the config, or use --node to run without Nub's TypeScript features, path aliases included.

Unit test covers the unreadable file on unix and skips under root, which reads through the mode bits. Follow-up to #778.

https://claude.ai/code/session_01CD2jAnXLg1fVRzyRNAYTBr

A tsconfig the process was not allowed to read produced the same bare
"Cannot resolve tsconfig at path: <path>" as a missing one, and the CLI's
verdict then told the reader to fix a config that was fine. Seen when a
macOS terminal lost TCC access to ~/Documents: every `nub <file>` in a
project there failed on the tsconfig line with nothing pointing at the OS.

The read diagnostic now carries the io::Error, matching the parse
diagnostics on the same path. Unit test covers the unreadable-file case
on unix and skips under root, which reads through the mode bits.

Claude-Session: https://claude.ai/code/session_01CD2jAnXLg1fVRzyRNAYTBr
Copilot AI lite review requested due to automatic review settings September 5, 2026 23:30
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nub Ready Ready Preview Sep 5, 2026 11:31pm UTC

Request Review

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes Checked the complete one-file patch and its effect on the CLI's tsconfig refusal path.

  • OS error contextread_jsonc now preserves the underlying std::io::Error when a discovered tsconfig cannot be read.
  • Regression coverage — The Unix permissions test distinguishes the old path-only diagnostic from the new cause-bearing message and safely skips privileged runners.

Pullfrog  | View workflow run | Using GPT Sol𝕏

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.

2 participants