Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(rsc): fix plugin name in client-only error message#862

Merged
hi-ogawa merged 2 commits intomainfrom
09-16-fix_rsc_tweak_client-only_error_message
Sep 16, 2025
Merged

fix(rsc): fix plugin name in client-only error message#862
hi-ogawa merged 2 commits intomainfrom
09-16-fix_rsc_tweak_client-only_error_message

Conversation

Copy link
Contributor

hi-ogawa commented Sep 16, 2025 *
edited
Loading

Description

Currently client-only error shows up as rsc:virtual-client-package:

[rsc:virtual-client-package] 'client-only' cannot be imported in server build (importer: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin -rsc/examples/starter/src/root.tsx', environment: rsc)

We can hard-code server-only/client-only here to skip this step, so the error gets surfaced as:

[rsc:validate-imports] 'client-only' cannot be imported in server build (importer: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin -rsc/examples/starter/src/root.tsx', environment: rsc)

This isn't fool proof though since other plugins might use this.resolve too. Eventually we should look into to surfacing errors later stage so we have a knowledge of module graph. Tracked in #863.

hi-ogawa changed the title fix(rsc): improve client-only error message fix(rsc): improve server-only and client-only error message Sep 16, 2025
hi-ogawa changed the title fix(rsc): improve server-only and client-only error message fix(rsc): tweak server-only and client-only error message Sep 16, 2025
hi-ogawa marked this pull request as ready for review September 16, 2025 05:36
hi-ogawa changed the title fix(rsc): tweak server-only and client-only error message fix(rsc): show plugin name in server-only and client-only error message Sep 16, 2025
hi-ogawa changed the title fix(rsc): show plugin name in server-only and client-only error message fix(rsc): fix plugin name in client-only error message Sep 16, 2025
hi-ogawa changed the title fix(rsc): fix plugin name in client-only error message fix(rsc): fix plugin name in client-only error message Sep 16, 2025
hi-ogawa merged commit 0f2fbc7 into main Sep 16, 2025
22 of 23 checks passed
hi-ogawa deleted the 09-16-fix_rsc_tweak_client-only_error_message branch September 16, 2025 05:44
hi-ogawa mentioned this pull request Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant