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

Runtime Exceptions aren't displayed in the UI console when using DDC/Flutter #1365

Closed
johnpryan opened this issue Nov 8, 2019 · 2 comments
Closed
Labels
area-error-messaging P1 A high priority bug; for example, a single project is unusable or has many test failures type-ux A user experience or user interface related issue
Milestone

Comments

@johnpryan
Copy link
Contributor

Exceptions in DDC are reported to the window.onerror callback. Right now, these errors are being reported as "Script error." because the script is being loaded from a different domain. (See this article.) Non-async exceptions are caught by the Flutter framework and printed to the console.

The response headers from the compileDDC endpoint already have an access-control-allow-origin: * header, so setting the crossorigin attribute to anonymous should solve this problem, but doesn't seem to work for me.

We should investigate different options for capturing and reporting errors. For example, the future returned by a module calling main() can be listened to for errors, but won't catch everything:

dartpad_main.main.main().catchError(function (e, st) {
parent.postMessage(
  {'sender': 'frame', 'type': 'stderr', 'message': e + st}, '*');
});

Another option is to use zones, but this requires more investigation

related to #1357

@johnpryan
Copy link
Contributor Author

Related to flutter/flutter#41878

@RedBrogdon RedBrogdon added P2 A bug or feature request we're likely to work on type-ux A user experience or user interface related issue labels Nov 22, 2019
@RedBrogdon RedBrogdon added this to the Backlog milestone Nov 22, 2019
@johnpryan johnpryan added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Oct 6, 2022
@johnpryan johnpryan changed the title Report better exceptions for Flutter apps Runtime Exceptions aren't displayed in the UI console when using DDC/Flutter Oct 13, 2022
@parlough
Copy link
Member

I'm not sure the full current state of surfacing runtime exceptions, but I'm going to close this in favor of consolidating with the work in #3008. Thanks!

@parlough parlough closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-error-messaging P1 A high priority bug; for example, a single project is unusable or has many test failures type-ux A user experience or user interface related issue
Projects
None yet
Development

No branches or pull requests

3 participants