emotion-js / emotion

👩‍🎤 CSS-in-JS library designed for high performance style composition
https://emotion.sh/
MIT License
17.5k stars 1.11k forks source link

Getting this error: Uncaught TypeError: dispatcher.useInsertionEffect is not a function #3107

Open SaiTeja-Tal opened 1 year ago

SaiTeja-Tal commented 1 year ago

From today morning, we suddenly ran into this issue and couldn't run any of our applications. Can someone please look into this?

image

Uncaught TypeError: dispatcher.useInsertionEffect is not a function at useInsertionEffect (react.development.js:1639:21) at useInsertionEffectMaybe (emotion-styled-base.browser.esm.js:51:3) at Insertion (emotion-styled-base.browser.esm.js:61:15) at renderWithHooks (react-dom.development.js:14985:18) at mountIndeterminateComponent (react-dom.development.js:17811:13) at beginWork (react-dom.development.js:19049:16) at HTMLUnknownElement.callCallback (react-dom.development.js:3945:14) at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:16) at invokeGuardedCallback (react-dom.development.js:4056:31) at beginWork$1 (react-dom.development.js:23959:7)

The above error occurred in the component:

at Insertion (webpack://operations-portal-ui/./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js?:57:20)
at eval (webpack://operations-portal-ui/./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js?:57:66)
at Box (webpack://operations-portal-ui/./node_modules/@mui/material/node_modules/@mui/system/esm/createBox.js?:37:72)
at App (webpack://operations-portal-ui/./src/containers/App/index.tsx?:58:74)
at ThemeProvider (webpack://operations-portal-ui/./node_modules/@mui/material/node_modules/@mui/system/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js?:42:5)
at ThemeProvider (webpack://operations-portal-ui/./node_modules/@mui/material/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js?:54:5)
at Router (webpack://operations-portal-ui/./node_modules/react-router/index.js?:206:15)
at BrowserRouter (webpack://operations-portal-ui/./node_modules/react-router-dom/index.js?:116:5)
at QueryClientProvider (webpack://operations-portal-ui/./node_modules/react-query/es/react/QueryClientProvider.js?:39:21)
at Provider (webpack://operations-portal-ui/./node_modules/react-redux/es/components/Provider.js?:16:20)
at RootApp
Andarist commented 1 year ago

Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.

Mahboobeh-sayadiyan commented 1 year ago

same issue after upgrading Nodejs to version 18 "@emotion/babel-plugin": "^11.11.0", "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/core": "^11.0.0", "@emotion/react": "^11.10.8", "@emotion/styled": "^11.10.8", "react": "^17.0.2", "react-dom": "^17.0.2",

Screen Shot 2023-09-14 at 1 58 02 PM
Andarist commented 1 year ago

I honestly can't give a different answer than before. Please create a runnable repro case to make it possible for me to dive straight into the problem.

paulohlvs commented 1 year ago

Boa tarde! Teria alguma solução de imediato para este erro, estou com aplicação em produção e após ultimo commit no dia 15/09 ocorreu o mesmo problema, estou utilizando react 17 e não posso atualizar para react 18 devido outras bibliotecas. segue bibliotecas e versões sendo utilizada no projeto.

"@emotion/react": "11.10.0", "@emotion/styled": "11.10.0", "@mui/icons-material": "5.10.6", "@mui/material": "5.10.1", "@mui/styles": "5.10.7", "react": "17.0.1", "react-dom": "17.0.1",

image

RaunaqPurohitCredila commented 1 year ago

Hi , I too faced same issue as above mentioned. Same issue and also couldn't upgrade React version. I could fix it by forcefully upgrade React to v18 by installing it by npm install react@18.2.0 --force. Hope this works!!

khomyakov42 commented 10 months ago

I can fix this issue, when remove alias for react-dom from webpack.conf.js

                alias: {
                    "react-dom": "@hot-loader/react-dom",
                },