From 151b99bef42c4223121334f86c3f1616db289952 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:34:23 +0900 Subject: [PATCH 1/2] fix: log error when send in module runner failed --- packages/vite/src/shared/hmr.ts | 4 +++- packages/vite/src/shared/moduleRunnerTransport.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/shared/hmr.ts b/packages/vite/src/shared/hmr.ts index 76c4ece4d44919..342e0894bef971 100644 --- a/packages/vite/src/shared/hmr.ts +++ b/packages/vite/src/shared/hmr.ts @@ -190,7 +190,9 @@ export class HMRClient { } public send(payload: HotPayload): void { - this.transport.send(payload) + this.transport.send(payload).catch((err) => { + this.logger.error(err) + }) } public clear(): void { diff --git a/packages/vite/src/shared/moduleRunnerTransport.ts b/packages/vite/src/shared/moduleRunnerTransport.ts index f10ef69ba193bf..8fad9b0d2f5fe0 100644 --- a/packages/vite/src/shared/moduleRunnerTransport.ts +++ b/packages/vite/src/shared/moduleRunnerTransport.ts @@ -179,7 +179,7 @@ const createInvokeableTransport = ( export interface NormalizedModuleRunnerTransport { connect?(onMessage?: (data: HotPayload) => void): Promise | void disconnect?(): Promise | void - send(data: HotPayload): void + send(data: HotPayload): Promise invoke( name: T, data: Parameters, From a5509dbdbd1cf50087b3e388dea6fbb66a22a94f Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:38:40 +0900 Subject: [PATCH 2/2] chore: bump bundle size --- packages/vite/rollup.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/rollup.config.ts b/packages/vite/rollup.config.ts index 1cf3015f15d52f..5727cb537a046c 100644 --- a/packages/vite/rollup.config.ts +++ b/packages/vite/rollup.config.ts @@ -194,7 +194,7 @@ const moduleRunnerConfig = defineConfig({ ], plugins: [ ...createSharedNodePlugins({ esbuildOptions: { minifySyntax: true } }), - bundleSizeLimit(53), + bundleSizeLimit(54), ], })