Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Turbopack] print invalid message correctly #69964

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ export default function HotReload({
)
} catch (err: any) {
console.warn(
'[HMR] Invalid message: ' + event.data + '\n' + (err?.stack ?? '')
'[HMR] Invalid message: ' +
JSON.stringify(event.data) +
'\n' +
(err?.stack ?? '')
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export default function connect(mode: 'webpack' | 'turbopack') {
processMessage(payload)
} catch (err: any) {
console.warn(
'[HMR] Invalid message: ' + payload + '\n' + (err?.stack ?? '')
'[HMR] Invalid message: ' +
JSON.stringify(payload) +
'\n' +
(err?.stack ?? '')
)
}
})
Expand Down
5 changes: 4 additions & 1 deletion packages/next/src/client/dev/amp-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ addMessageListener((message) => {
}
} catch (err: any) {
console.warn(
'[HMR] Invalid message: ' + message + '\n' + (err?.stack ?? '')
'[HMR] Invalid message: ' +
JSON.stringify(message) +
'\n' +
(err?.stack ?? '')
)
}
})
Expand Down
Loading