Skip to content

fix: resolve baseUrl / paths relative to the real path of the tsconfig#1080

Open
sapphi-red wants to merge 1 commit intomainfrom
03-23-fix_resolve_baseurl___paths_relative_to_the_real_path_of_the_tsconfig
Open

fix: resolve baseUrl / paths relative to the real path of the tsconfig#1080
sapphi-red wants to merge 1 commit intomainfrom
03-23-fix_resolve_baseurl___paths_relative_to_the_real_path_of_the_tsconfig

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

@sapphi-red sapphi-red commented Mar 23, 2026

When a tsconfig extends another tsconfig through a symlinked path (common in pnpm workspaces where node_modules/pkg is a symlink), baseUrl and paths were computed relative to the symlink location instead of the real file location (vitejs/vite#21856).

Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (ee4f426) to head (449abd2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1080      +/-   ##
==========================================
+ Coverage   92.35%   92.42%   +0.07%     
==========================================
  Files          21       21              
  Lines        4079     4104      +25     
==========================================
+ Hits         3767     3793      +26     
+ Misses        312      311       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sapphi-red sapphi-red marked this pull request as ready for review March 23, 2026 09:09
@sapphi-red sapphi-red requested a review from Boshen March 23, 2026 09:09
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 23, 2026

Merging this PR will not alter performance

✅ 13 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing 03-23-fix_resolve_baseurl___paths_relative_to_the_real_path_of_the_tsconfig (449abd2) with main (4d89b43)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@gerardatkonvo
Copy link
Copy Markdown

Can we merge this?

thomasheartman added a commit to Unleash/unleash that referenced this pull request May 4, 2026
This is an attempt to fix the Enterprise build issue due to to
theme/app.css not being found. Claude suggests that it may be related to
Vite 8's built-in `resolve.tsconfigPaths: true` not handling
baseUrl-relative resolution reliably.

I'm not positive that this will fix it, but it's a small change and it
goes back to the way we did it before vite8, so it seems worth trying.
It's hard to replicate locally, so this is probably the quickest way to
validate it. For reference, the handling was updated in
#11766.

Running the front end with this plugin makes vite emit this:
> The plugin "vite-tsconfig-paths" is detected. Vite now supports
tsconfig paths resolution natively via the resolve.tsconfigPaths option.
You can remove the plugin and set resolve.tsconfigPaths: true in your
Vite config instead.

However, there may still be some issues left to fix (e.g.
vitejs/vite#21856 ; upstream PR to fix it
oxc-project/oxc-resolver#1080)


Claude's summary:

Vite 8's built-in `resolve.tsconfigPaths: true` only handles `paths`
mappings reliably; baseUrl-relative resolution is fragile in some
environments (we hit it in enterprise's pnpm-driven prepack of OSS,
where `themes/app.css` and similar bare imports failed to resolve).

The pre-Vite-8 `vite-tsconfig-paths` plugin handled both. Re-add it with
the same plugin position as before, and drop the built-in flag to avoid
two resolvers disagreeing on edge cases. Drop the plugin again once the
built-in handler matures.
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.

3 participants