Repository navigation
fix(app): load component-test modules at the URLs Vite imports them by - #53091
Merged
Merged
Conversation
Hona
added a commit
to Hona/opencode
that referenced
this pull request
Oct 4, 2026
v2 fixes the same module identity problem with sourceURL (anomalyco#53091).
Ichinose-Kazuki
pushed a commit
to Ichinose-Kazuki/opencode
that referenced
this pull request
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
e2e (linux)fails on every PR againstv2(for example run 37175224254 on #53012) because two app component tests fail on every attempt:component-tests/browser-pane-restore.spec.ts:43keeps a restored browser tab selected and undrawn until the desktop's first inventorycomponent-tests/browser-pane-restore.spec.ts:65keeps the browser tabs while the pane's Ipc is away and registers them again when it returnsRoot cause
The component specs build Vite module URLs as
`/@fs/${fileURLToPath(...)}`. On POSIX,fileURLToPathreturns a path that starts with/, so the specs import/@fs//home/.../language.tsx(double slash). Vite rewriteshost.tsx's own@/runtime/i18n/languageimport to/@fs/home/.../language.tsx(single slash). The browser treats these as two different modules, so theLanguageProviderthe spec passes to the fixture provides oneLanguageContext, whileExtensionHostProviderreads a different one.The bug was already in the specs. #52868 (
0048c97c27) exposed it by adding theRun app component testsstep to CI. Windows passes because its paths become/@fs/C:/..., which is the same URL Vite uses.What changes
sourceURL(url)topackages/storybook/playwright/story.ts. It returns/@fs${url.pathname}, which matches the URLs Vite rewrites imports to on POSIX and Windows./@fsURL. The other specs only load a single fixture each, so they weren't failing, but they had the same double-slash URLs.story.d.ts.No assertions change.
Verification
origin/v2(macOS, which also produces/@fs//Users/...):bun run test:components -- browser-pane-restore.spec.ts --retries=0fails both tests with the sameLanguage contexterror.packages/app:bun run test:components -- browser-pane-restore.spec.ts --retries=0: 2 passedCI=1 bun run test:components: 92 passed, 0 flakypackages/session-ui:CI=1 bun run test:components: 130 passedbun typecheckpasses inpackages/appandpackages/session-ui.bun run checkfrom the repo root: 36/36 tasks passed.