Skip to content
12 changes: 9 additions & 3 deletions client-src/index.js
Original file line number Diff line number Diff line change
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