Skip to content

fix(cli): use an absolute rootDir when the project is analyzed - #5787

Open
dlhck wants to merge 1 commit into
majorfrom
dhoeck/plat-754-fix-the-cli-for-projects-with-a-composite
Open

dlhck wants to merge 1 commit into
majorfrom
dhoeck/plat-754-fix-the-cli-for-projects-with-a-composite

Conversation

@dlhck

@dlhck dlhck commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

analyzeProject() passes the relative rootDir: './src' to ts-morph. When the project tsconfig.json has composite: true, TypeScript compares that relative path with an absolute path and throws:

Debug Failure. False expression: Paths must either both be absolute or both be relative

Projects that use composite: true, for example with project references, are affected. The vendure schema, vendure add, vendure migrate and vendure doctor (config check) commands call analyzeProject(), so they fail in such a project. Projects without composite: true are not affected.

The fix is one line: rootDir: path.resolve('./src').

The new test, shared-prompts.spec.ts, runs analyzeProject() in a temporary project and asserts that the source file in src/ is loaded. One case uses a plain tsconfig. The other uses composite: true, and it fails without the fix with the error above. The test removes the temporary directory afterwards.

Breaking changes

No.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A relative rootDir made TypeScript throw when the project tsconfig has composite: true.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
vendure-storybook Ready Ready Preview Nov 14, 2026 7:51am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@dlhck
dlhck marked this pull request as ready for review November 14, 2026 08:06

This branch was successfully deployed

1 active deployment
Preview — 4affbe13 Deployed Nov 14, 2026 by vercel[bot]
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.

1 participant