Skip to content

fix(test): resolve vendor-aliases paths from package root, not distRoot#985

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/vitest-browser-context-vendor-aliases
Mar 17, 2026
Merged

fix(test): resolve vendor-aliases paths from package root, not distRoot#985
graphite-app[bot] merged 1 commit intomainfrom
fix/vitest-browser-context-vendor-aliases

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Mar 17, 2026

The vendorMap in the vendor-aliases plugin was resolving @vitest/* paths
relative to distRoot (dist/@vitest/browser/), producing doubled paths like
dist/@vitest/browser/@vitest/browser/context.js. Use packageRoot (dist/)
instead, fixing resolution for third-party imports like @storybook/addon-vitest.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


Note

Low Risk
Low risk: a one-line change in the test build-time patcher that only affects how @vitest/* alias paths are resolved in the injected browser plugin.

Overview
Fixes the injected vitest:vendor-aliases plugin so its @vitest/* alias map resolves files from the dist package root (packageRoot/dist/) instead of distRoot (dist/@vitest/browser/).

This prevents incorrect doubled paths when third-party tools import @vitest/* modules in browser mode.

Written by Cursor Bugbot for commit 33c6164. This will update automatically on new commits. Configure here.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 17, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 334863a
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69b8cb2c4c28290008f2421e

Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add the label auto-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.

@Brooooooklyn Brooooooklyn added the test: e2e Auto run e2e tests label Mar 17, 2026
@Brooooooklyn Brooooooklyn requested a review from fengmk2 March 17, 2026 03:19
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Mar 17, 2026

Merge activity

…ot (#985)

The vendorMap in the vendor-aliases plugin was resolving @vitest/* paths
relative to distRoot (dist/@vitest/browser/), producing doubled paths like
dist/@vitest/browser/@vitest/browser/context.js. Use packageRoot (dist/)
instead, fixing resolution for third-party imports like @storybook/addon-vitest.

- Close #963

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: a one-line change in the test build-time patcher that only affects how `@vitest/*` alias paths are resolved in the injected browser plugin.
>
> **Overview**
> Fixes the injected `vitest:vendor-aliases` plugin so its `@vitest/*` alias map resolves files from the dist *package root* (`packageRoot`/`dist/`) instead of `distRoot` (`dist/@vitest/browser/`).
>
> This prevents incorrect doubled paths when third-party tools import `@vitest/*` modules in browser mode.
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 33c6164. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@graphite-app graphite-app bot force-pushed the fix/vitest-browser-context-vendor-aliases branch from 33c6164 to 334863a Compare March 17, 2026 03:31
@graphite-app graphite-app bot merged commit 334863a into main Mar 17, 2026
41 checks passed
@graphite-app graphite-app bot deleted the fix/vitest-browser-context-vendor-aliases branch March 17, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subpath import of @vitest/browser/context from @storybook/addon-vitest fails.

2 participants