Skip to content

Fix fatal error when project reference objects have unexpected types for path and circular#4270

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-fatal-error-project-reference-objects
Draft

Fix fatal error when project reference objects have unexpected types for path and circular#4270
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-fatal-error-project-reference-objects

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

parseProjectReference used bare type assertions (v.(string), v.(bool)) that panic when tsconfig references entries contain non-string path or non-bool circular values:

{ "references": [{ "path": true }] }

Fix

Use comma-ok type assertions. When path is not a string, the reference gets an empty Path, which the existing caller logic already handles by emitting the "reference.path" requires type "string" diagnostic—matching TypeScript's behavior. Non-bool circular is silently ignored (defaults to false).

Copilot Checklist

I successfully ran these commands at the end of my session, and they completed without error:

  • npx hereby build
  • npx hereby test
  • npx hereby lint
  • npx hereby format

…types

Use safe type assertions (comma-ok idiom) in parseProjectReference instead
of bare type assertions that panic when values are not string/bool.

Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fatal error for project reference objects with unexpected types Fix fatal error when project reference objects have unexpected types for path and circular Jun 11, 2026
Copilot AI requested a review from DanielRosenwasser June 11, 2026 01: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.

Fatal error when project reference objects have unexpected types for path and circular

2 participants