React is not defined
See original GitHub issueI hope you can help me figure this one out.
Everything works perfectly in dev mode, but if I build the project, I end up with React is not defined
error. The issue happens when I try to import OverlayProvider
from @react-aria/overlays
. Not sure what exactly the problem is. Tried adding react
as an alias, but it doesn’t help. Also not sure what the difference is between dev and prod config that would account for this. Any thoughts?
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Uncaught ReferenceError: React is not defined - Stack Overflow
Possible reasons are 1. you didn't load React.JS into your page, 2. you loaded it ...
Read more >'X' is not defined react/jsx-no-undef Error in React | bobbyhadz
The React.js error "X is not defined react/jsx-no-undef" occurs when we forget to import a function, class or a variable in our code...
Read more >Getting "Uncaught ReferenceError: react is not defined".
Hi Louie Ambriz, It's hard to tell without seeing your code but it sounds like React is not being loaded into your project....
Read more >[v4]ReferenceError: React is not defined · Issue #9882 - GitHub
I have submitted PR #9885 to fix this. This is because the jsx-runtime configuration gets removed webpack config during the ejection process ...
Read more >Uncaught ReferenceError: React is not defined
Hi! You don't have to import React because you're using unpkg so React and ReactDOM are already available for you :wink:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, sorry. I should have done it right away. Will report back.
I upgraded all the dependencies in my project’s package.json and the error disappeared. I’m unblocked, but I’ve also learned nothing. On the off-chance that this is helpful information for anyone, the deps I upgraded: