-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Show a better message if React is not loaded #10406
Comments
@gaearon this throws in |
I'm not sure. On the one hand throwing in that specific place would prevent this specific confusing error. On the other hand, there's no guarantee that it will throw there first. Renderer might use APIs on React object earlier. |
Is there a way to determine in which order rollup will load modules, or explicitly include a snippet of code at the top of the bundle? If I add the invariant to the entry point for the bundle, it still fails with the cryptic error since the imported modules are hoisted to the top of the bundle. |
You can add a module like checkReact and then make it first import in the renderer. Then it's guaranteed to execute first. |
Currently if React is not loaded, ReactDOM shows this:
We should throw a nicer error message in the entry point I think.
The text was updated successfully, but these errors were encountered: