Skip to content
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

fix: add client.overlay.runtimeErrors options #4773

Merged
12 changes: 9 additions & 3 deletions client-src/index.js
Expand Up @@ -118,9 +118,15 @@ self.addEventListener("beforeunload", () => {
const trustedTypesPolicyName =
typeof options.overlay === "object" && options.overlay.trustedTypesPolicyName;

const overlay = createOverlay({
trustedTypesPolicyName,
});
const overlay = options.overlay

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malcolm-kee this is not sufficient. You are only checking if options.overlay is truthy. All options need to be passed into the createOverlay() function. The overlay options are errors: boolean & warnings: boolean.

Then, the show() function in overlay.js needs to check if the type is "warning" or "error" and compare the passed options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crobinson42 good catch!

I just pushed a fix so that runtime error check the options as well.

For build error/warning, it's already handled:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testa are failed, can you look what is wrong (no rush), I think today after rest we will fix all issues

? createOverlay({
trustedTypesPolicyName,
})
: {
send() {
// noop
},
};

const onSocketMessage = {
hot() {
Expand Down