Open bobsilverberg opened 4 years ago
I investigated this issue a bit, and found that the simulated async error could not be caught by the Error boundaries, and finally brings down the frontend host server (localhost:3333). This same problem occurs in local, dev and stage as long as allowErrorSimulation
is true.
STR:
In order to catching the async error, we have to do a trick https://github.com/facebook/react/issues/14981#issuecomment-468460187 when throwing out the error. I am not sure if we would like to do it in our SimulateAsyncError
, since the web still could not deal with other (unexpected) async errors which are not "wrapped" in setState
.
@bobsilverberg Do we need to add something to handle async errors which occur in rendering on the server (maybe in core/server/base.js)? or any other suggestions? https://github.com/mozilla/addons-frontend/blob/d4f2cbae670f0ceb4e4fe93501aa1e31a0d82df3/src/core/server/base.js#L113
Would we ever have an async error when rendering on the server (except with this artificial one we create for testing purposes)? We don't actually render anything meaningful on the server, unlike in addons-frontend.
@willdurand WDYT, is this something we need to worry about?
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.
Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDFRNT-173
While reviewing mozilla/addons-frontend#9122, I discovered that http://localhost:3000/en-US/firefox/simulate-async-error/ is broken. When I try to load that route, I get the "Webpack is still loading!" page and then the server stops responding. Here's what I see in the console:
┆Issue is synchronized with this Jira Task