Skip to content

Commit 8bb8836

Browse files
committed
fix(rsc): handle syntax errors before server hmr
1 parent 73d457b commit 8bb8836

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ export default function vitePluginRsc(
382382

383383
if (!isInsideClientBoundary(ctx.modules)) {
384384
if (this.environment.name === 'rsc') {
385+
// transform js to surface syntax errors
386+
for (const mod of ctx.modules) {
387+
if (mod.type === 'js') {
388+
await this.environment.transformRequest(mod.url)
389+
}
390+
}
385391
// server hmr
386392
ctx.server.environments.client.hot.send({
387393
type: 'custom',

0 commit comments

Comments
 (0)