Skip to content

Commit

Permalink
fix: log error when send in module runner failed (#18753)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Nov 25, 2024
1 parent 4d2abc7 commit ba821bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/vite/src/shared/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/shared/moduleRunnerTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const createInvokeableTransport = (
export interface NormalizedModuleRunnerTransport {
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void
disconnect?(): Promise<void> | void
send(data: HotPayload): void
send(data: HotPayload): Promise<void>
invoke<T extends keyof InvokeMethods>(
name: T,
data: Parameters<InvokeMethods[T]>,
Expand Down

0 comments on commit ba821bb

Please sign in to comment.