We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c3ec47 commit 6391d04Copy full SHA for 6391d04
packages/react-server/src/features/client-component/plugin.ts
@@ -129,6 +129,12 @@ export function vitePluginServerUseClient({
129
const useClientPlugin: Plugin = {
130
name: vitePluginServerUseClient.name,
131
async transform(code, id, _options) {
132
+ // when using external library's server component includes client reference,
133
+ // it will end up here with deps optimization hash `?v=` resolved by server module graph.
134
+ if (!manager.buildType && id.includes("?v=")) {
135
+ console.error("[useClientPlugin]", { id });
136
+ id = id.split("?v=")[0]!;
137
+ }
138
manager.serverIds.add(id);
139
manager.clientReferenceIds.delete(id);
140
if (!code.includes(USE_CLIENT)) {
0 commit comments