-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[web]: Red Screen Of Death when running in Release Mode (example app included) #40421
Comments
@janmoppel can you try running a profile build |
@jonahwilliams Do we have sourcemaps working in release builds? |
You don't get source maps in release builds. At any rate, by default release builds are built with O4 which might be too much optimization if the application has type errors - but I would also expect to see that in profile mode (which is O2) |
Why don't we output source maps in release builds? I imagine this will be very important for debugging production issues. |
Sorry for the delay in getting to this. It looks like in your package you are using relative imports to refer to types in
Due to the way that dart2js canonicalizes types, in order to use a type in a
This problem should go away if you change all of your imports to |
Thanks for taking your time to investigate this! Gonna give it a try once I have some time and will let you know if it helps. |
@hterkelsen ...so I've changed all the imports to be package imports and tried latest beta channel ...and the screen is now grey instead of red in the release mode. Also there is no error shown in chrome console.
...and it works just fine in the profile mode. |
Sorry for the delay in responding, I was on vacation. I can confirm that I see the problem in release mode and not profile mode, which suggests to me that the problem is due to dart2js canonicalizing types. I will investigate a bit more and see if we need to file a bug with dart2js. |
This is not really fixed, is it? cc @hterkelsen |
Did a bit more investigation on my own and I think I found what the issue is. I enabled "error reporting" with the following:
and figured the problem with the error is coming from this bit I use in my library: Type _typeOf<T>() => T;
// this line produces unreadable garbage in the release mode rather than `HomeWidget`
_typeOf<HomeWidget>().toString() Now that I'm aware of this I can mitigate this somehow. Unsure if this is working as intended. It would be helpful if you could somehow omit canonicalizing specific types. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Assuming you're on master channel and enabled web support:
My example app just works in debug mode:
But using the same command in release mode:
results in the red screen of death:
interestingly some things still work in the release mode, e.g. you can navigate to the
/fab
widgetby typing in the address bar
http://localhost:port/#/fab
Flutter doctor:
The text was updated successfully, but these errors were encountered: