Skip to content

Commit 43bb5ae

Browse files
committed
Check for server modules with getModulesByFile
1 parent e1a35d3 commit 43bb5ae

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/react-router-dev/vite/rsc/plugins/hmr-invalidate-client-only-modules-in-rsc.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ export function hmrInvalidateClientOnlyModulesInRsc(): Vite.Plugin {
1010
return;
1111
}
1212

13-
const updatedServerModule = this.environment.moduleGraph.getModuleById(
14-
ctx.file,
15-
);
13+
const updatedServerModules =
14+
this.environment.moduleGraph.getModulesByFile(ctx.file);
1615

1716
// If this file is in the RSC graph, it's not a client-only module and
1817
// changes will already be picked up, so bail out
19-
if (updatedServerModule) {
18+
if (updatedServerModules && updatedServerModules.size > 0) {
2019
return;
2120
}
2221

0 commit comments

Comments
 (0)