-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: add client.overlay.runtimeErrors options #4773
Conversation
@alexander-akait I added the fix and verified it by testing it manually. If automated test is a must-have I'll have to do it tomorrow as I'm very tired now (it's 3am here). |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4773 +/- ##
==========================================
- Coverage 92.10% 90.43% -1.68%
==========================================
Files 16 16
Lines 1659 1662 +3
Branches 618 622 +4
==========================================
- Hits 1528 1503 -25
- Misses 120 145 +25
- Partials 11 14 +3
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
client-src/index.js
Outdated
const overlay = createOverlay({ | ||
trustedTypesPolicyName, | ||
}); | ||
const overlay = options.overlay |
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.
@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.
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.
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.
@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:
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.
Testa are failed, can you look what is wrong (no rush), I think today after rest we will fix all issues
client-src/index.js
Outdated
typeof options.overlay === "object" | ||
? { | ||
trustedTypesPolicyName: options.overlay.trustedTypesPolicyName, | ||
catchRuntimeError: options.overlay.errors, |
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.
Also ideally we need a new option for such stuff, i.e. catchRuntimeError
, because as you can see some application works in very differents envs and it can be errors outside own application
@@ -80,6 +80,7 @@ if (parsedResourceQuery.overlay) { | |||
options.overlay = { | |||
errors: true, | |||
warnings: true, | |||
runtimeErrors: true, |
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.
@alexander-akait I'm having problem to run the test for webpack5 to update snapshot. I tried to run it it will stuck without any reason. It's the same with |
I will update tests don't worry |
Reported in #4771
fixes #4774
fixes #4771
client.overlay.runtimeErrors
options - default totrue
.For Bugs and Features; did you add new tests?
Motivation / Use-Case
Breaking Changes
Additional Info