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

Fix crashes related to loading React 16.4.1 #558

Merged
merged 2 commits into from
Jun 30, 2018

Conversation

dustinsoftware
Copy link
Member

@dustinsoftware dustinsoftware commented Jun 29, 2018

Fixes #555

If React fails to load from a user-provided bundle, the script load
exception would be hidden from the user, because the exception is stored
to a field and then rethrown later. EnsureReactLoaded was
getting called before the real exception was thrown, which threw a new
(unhelpful) exception.
In some cases, React (or other libraries) will assume that setTimeout
and clearTimeout are defined on the global scope, without invoking it.

We should still throw an error in case a consumer expects this to just
work on the server (it won't), but we can avoid a crash by defining the
function on the global scope.

For context: reactjs#555
@dustinsoftware dustinsoftware changed the title Fix unhelpful error message if React can't be loaded Fix crashes related to loading React 16.4.1 Jun 29, 2018
@dustinsoftware dustinsoftware merged commit b3455fd into reactjs:master Jun 30, 2018
@Daniel15
Copy link
Member

Daniel15 commented Jul 1, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants