fix(rsc): pass root importer explicitly instead of undefined for this.resolve in rsc:virtual-client-package #1295
Merged
hi-ogawa merged 5 commits intoJul 23, 2026
Conversation
Contributor
Author
|
@hi-ogawa can you have a look, latest version blocks our builds 🙏 |
Contributor
|
Doing this explicitly does make sense (I remember just seeing this on Vitest https://github.com/vitest-dev/vitest/blob/86c700ed8b77b7afb0ee9ec677ef8379f34a4bed/packages/vitest/src/node/plugins/vitestResolver.ts#L55) and fine to land nonetheless, but I'd appreciate more content on your setup. Vite’s built-in resolver already resolves bare packages from the project root when the importer is undefined, so |
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
approved these changes
Jul 23, 2026
undefined for this.resolve in rsc:virtual-client-package
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.
Description
@vitejs/plugin-rsc 0.5.28 added a project-root resolution check for client packages in #1277. In Rolldown builds, passing an undefined importer does not reliably represent the project root and can send importer-sensitive resolvers through a framework-owned dependency graph instead. In our case this caused runaway resolution and module-graph growth, ending in an OOM during the first RSC transform.
Resolve the package from the conventional /index.html importer explicitly. This preserves the #1277 behaviour: packages unavailable at the application root, or resolving to a different copy there, still fall back to the fully resolved module id.
Add a regression guard to the existing transitive client package fixture so build coverage fails if the root probe reaches another resolver without a concrete importer.
Reproduced with identical documentation content:
Related to #1247 and #1277.