-
Notifications
You must be signed in to change notification settings - Fork 196
Suggestion: Don't display error iframe #28
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
Comments
I thought the overlay only shows up when there are unhandled promise rejections? That's an Error by definition, isn't it? Or are you saying that it shows up even when the rejection is handled? |
I didn't handle promise rejection, that's my purpose. The program work well without handle rejection. Would you please add an option to disable this behavior? |
I just tested Promise.reject in RN 0.61, it's reported as a warning display at the bottom of screen. You recognize it as error. Whatever, I also want to have an option to disable showing error. |
My thoughts on this:
CC @gaearon your thoughts? |
Any progress? |
I'm currently on vacation and don't have much free time to do anything yet. You can submit a PR if you want this done quicker. |
For cases where you need to ignore a thrown exception, you should have something in your user code that is catching it and doing something with it (you could also use an Error Boundary): try {
const res = await api.post('data');
return res.data;
} catch (error) {
// if the promise is rejected
console.log(error); // log out the error, but catching here prevents this from being an uncaught exception
// do something to display error message
} Keep in mind that in React, if you hit an uncaught exception it will crash the entire app. From the React Docs:
This feature you are asking for is not just about development experience. It means that even if you ignored the error in development mode, it will still crash the React component tree. |
My project run well when I am using |
Ahh, my mistake, i was confusing rejected promises with uncaught exceptions. |
Error overlay should display unhandled rejections. It is easy to intentionally handle it by adding It is also true that we should offer a way to customize the error overlay to "redirect" it to another module. We'll need need this for opinionated integrations like Next. Seems like that would cover the use case for a "noop" overlay too anyway. |
Using the builtin error overlay in webpack creates duplicate overlays with this plugin active. I don't think it's a single plugins responsibility to provide an overlay, it should be explicitly configured or provided as part of an abstraction like CRA, Next etc. |
Are you talking about the compile-time or runtime overlay? |
Compile-time. EDIT: Wait, I get double error overlay for both |
webpack-dev-server provide builtin overlay already. |
I made a PR to make the overlay default off and added an option to add it back in. Wonder though if it might be better for the plugin to not worry about the overlay at all. |
I think it shouldn't be here at all, but as long as it's not forced upon me it doesn't really bother me |
We just hit a situation where the overlay makes our app unusable and prevents testing and development. I think maybe it shouldn't sorry about it at all, but even if you're unsure about that please merge the pr defaulting it to off while you decide. |
@pmmmwh ^^ |
Hi, sorry that I have been very busy lately. I'll take a look at it tomorrow and provide my thoughts on that. |
For anyone that stumbles upon this. supply this setting in your webpack config file
|
cameronscottseequent Thank you! That helped me. |
@cameronscottseequent thank you so much! that worked! |
Sometimes, the Promise reject data which is expected, but this plugin report error message by create an iframe#react-refresh-overlay element to html.body. That's boring, because I can see error message in Console.
This behavior will interrupted my mind and I have to close iframe by hand.
The text was updated successfully, but these errors were encountered: