Can't build a simple CRA app with v11.8.0
See original GitHub issueCurrent behavior:
A build of a CRA app with React 17, MUI 5 (thus requiring emotion) fails quickly with:
Creating an optimized production build...
Failed to compile.
Attempted import error: 'useInsertionEffect' is not exported from 'react' (imported as 'useInsertionEffect$1').
This looks like the lib erroneously try to require something that’s only available in React 18, while my app uses React 17.
To reproduce:
I can build a CSB if you feel it’s better, but really the steps are:
- Create a new CRA
- Add MUI 5 and emotion
- Setup MUI, Use a MUI component
- npm run build
Expected behavior:
Build succeeds
Environment information:
react
version: 17.0.2@emotion/react
version: 11.8.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:8 (2 by maintainers)
Top Results From Across the Web
TypeScript and React using create-react-app - Level Up Coding
This tutorial will show you how to quickly get started building React applications using TypeScript without needing any configuration by using create-react-app ......
Read more >Docker : Run a React app in a docker - 2020 - BogoToBogo
Create React App (CRA) is a tool to create a blank React app using a single terminal command. Besides providing something that works...
Read more >How To Set Up a React Project with Create React App
Starting a new JavaScript project with React used to be a complicated process. But now, Create React App includes all the JavaScript ...
Read more >create-react-app is not working since version 4.0.1
So to fix the error you're getting, uninstall create-react-app globally, update npm, clear the cache, and retry creating the app.
Read more >Don't use create-react-app: How you can set up your own ...
CRA is not boilerplate. It's build tool itself. You can DIY same kind of setup but you are really underestimating how much work...
Read more >Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
I’ve created a fix here and verified that it should work with CRA. I’m waiting for the CI and stuff but I should be able to release this somewhat soon.
I am also facing the same issue