-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: add client.overlay.runtimeErrors options #4773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c19595c
06900a7
c10a8ca
3f9a7dc
09040ad
2a016da
972633c
bbde757
1969246
c3640e4
68c7bbf
70c5566
a17765a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ import createSocketURL from "./utils/createSocketURL.js"; | |
| * @property {boolean} hot | ||
| * @property {boolean} liveReload | ||
| * @property {boolean} progress | ||
| * @property {boolean | { warnings?: boolean, errors?: boolean, trustedTypesPolicyName?: string }} overlay | ||
| * @property {boolean | { warnings?: boolean, errors?: boolean, runtimeErrors?: boolean, trustedTypesPolicyName?: string }} overlay | ||
| * @property {string} [logging] | ||
| * @property {number} [reconnect] | ||
| */ | ||
|
|
@@ -80,6 +80,7 @@ if (parsedResourceQuery.overlay) { | |
| options.overlay = { | ||
| errors: true, | ||
| warnings: true, | ||
| runtimeErrors: true, | ||
| ...options.overlay, | ||
| }; | ||
| } | ||
|
|
@@ -115,12 +116,23 @@ self.addEventListener("beforeunload", () => { | |
| status.isUnloading = true; | ||
| }); | ||
|
|
||
| const trustedTypesPolicyName = | ||
| typeof options.overlay === "object" && options.overlay.trustedTypesPolicyName; | ||
|
|
||
| const overlay = createOverlay({ | ||
| trustedTypesPolicyName, | ||
| }); | ||
| const overlay = options.overlay | ||
|
||
| ? createOverlay( | ||
| typeof options.overlay === "object" | ||
| ? { | ||
| trustedTypesPolicyName: options.overlay.trustedTypesPolicyName, | ||
| catchRuntimeError: options.overlay.runtimeErrors, | ||
| } | ||
| : { | ||
| trustedTypesPolicyName: false, | ||
| catchRuntimeError: options.overlay, | ||
| } | ||
| ) | ||
| : { | ||
| send() { | ||
| // noop | ||
| }, | ||
| }; | ||
|
|
||
| const onSocketMessage = { | ||
| hot() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default it to true.