Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

590
Vistas
Material ui export 'useInsertionEffect' (imported as 'useInsertionEffect$1') was not found in 'react' using Appbar component

here is the error.

1: https://i.stack.imgur.com/Y2Zdo.png**strong text**enter image description here

here i am trying to use Appbar component of material ui but i get this error

over 4 years ago · Santiago Trujillo
6 Respuestas
Responde la pregunta

0

I got a similar error, but not with Appbar. I was trying to create my own npm component library with mui v5 components.

ERROR in ./node_modules/comp-lib-mui5-sample/dist/esm/index.js 1293:9-29

export 'useInsertionEffect' (imported as 'e') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)

Downgrading or upgrading material and emotion, styled did not work.

In my rollup.config.js I had:

{
    input: "src/index.ts",
    output: [
        {
            file: pkg.main,
            format: "cjs",
            sourcemap: true,
        },
        {
           file: pkg.module,
           format: "esm",
           sourcemap: true,
         },
    ],
    plugins: [ //plugins here ],
},
{
    input: "dist/esm/types/index.d.ts",
    output: [{file: "dist/index.d.ts", format: "esm"}],
    plugins: [dts()],
    external: [/\.css$/],
},

esm - esm output is used for building for <script type=module> tag in modern browsers.
cjs – CommonJS, suitable for Node and other bundlers rollup output formats

Fix

New rollup.config.ts that uses only cjs:

{
   ...
    output: [
        {
            file: pkg.main,
            format: "cjs",
            sourcemap: true,
        },
        // REMOVED esm from here
    ],
    plugins: [ //plugins here ],
},
{
    input: "dist/types/index.d.ts", // CHANGED <--dist/esm/types/library.d.ts
    output: [{file: "dist/index.d.ts", format: "esm"}],
    plugins: [dts()],
    external: [/\.css$/],
},

(works with "@emotion/react": "^11.8.2", "@emotion/styled": "^11.8.1", "@mui/material": "^5.5.2")

Sample repositories:
component library Git repo
consumer of the library Git repo
(check README.md for more info.)

over 4 years ago · Santiago Trujillo Denunciar

0

It's possible that there is an error in the latest version of @emotion/react, 11.8.0. It was released 3h ago which would explain why it stopped working all of a sudden.

As a workaround, install the older version @emotion/react@11.7.1 to fix the problems.

over 4 years ago · Santiago Trujillo Denunciar

0

npm install @mui/material@5.4.2 @emotion/react@11.7.1 @emotion/styled@11.6.0 solves everything...

over 4 years ago · Santiago Trujillo Denunciar

0

This issue for other components in mui lib too, you can downgrade emotion/react to 11.7.1 till it's fixed 🚀

over 4 years ago · Santiago Trujillo Denunciar

0

Same happen for me! Downgrading to 11.7.1 fixed!

over 4 years ago · Santiago Trujillo Denunciar

0

This was a bug that was caused by useInsertionEffect being referenced directly in the specifiers list of the import statement (React.useInsertionEffect instead of React['useInsertion' + 'Effect']).

It is fixed as of @emotion/react@11.8.1 - upgrade to that version, and the error should disappear.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda