Answer №1

This issue stemmed from a bug triggered by the direct reference to useInsertionEffect in the specifiers list of the import statement (React.useInsertionEffect instead of React['useInsertion' + 'Effect']). You can find more details about this problem here.

The good news is that this has already been resolved, thanks to the changes made in this update which is included in version

@emotion/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="176572767463572626392f3926">[email protected]</a>
. Simply upgrade to this version and the error should no longer persist.

Answer №3

I encountered a similar issue, although not related to Appbar. My challenge involved creating a custom npm component library using mui v5 components.

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

The export 'useInsertionEffect' (imported as 'e') was not found in 'react' (possible exports listed)

Attempts to downgrade or upgrade the material and emotion, styled packages did not resolve the problem.

In my rollup.config.js setup:

{
    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$/],
},

The esm output is used for building <script type=module> tag in modern browsers.
The cjs format is suitable for Node and other bundlers check rollup output formats here

Solution

To address this issue, I updated the rollup.config.ts to only use cjs:

{
   ...
    output: [
        {
            file: pkg.main,
            format: "cjs",
            sourcemap: true,
        },
        // Removed esm output configuration
    ],
    plugins: [ //plugins here ],
},
{
    input: "dist/types/index.d.ts", // Updated path from dist/esm to dist/types/library.d.ts
    output: [{file: "dist/index.d.ts", format: "esm"}],
    plugins: [dts()],
    external: [/\.css$/],
},

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

Sample repositories:
component library Access Git repository
consumer of the library View Git repository
(Check README.md for additional details.)

Answer №4

It seems there may be an issue with the most recent release of @emotion/react, version 11.8.0. Since it was only released 3 hours ago, this could explain why it suddenly stopped working.

To address this issue, a temporary solution would be to revert back to the previous version of

@emotion/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5f2d3a3e3c2b1f6e6e7168716e">[email protected]</a>
.

Answer №5

The problem extends to other components in the mui library as well. You have the option to revert back to version 11.7.1 of emotion/react until the issue is resolved 🚀

Answer №6

After encountering an issue with my component library, built using @mui and React 18, not being compatible with a consuming application running on v17, I followed the suggestion of @Savchyk Vladyslav to use older versions of @emotion/react and @emotion/styled. Surprisingly, there were no reports of this specific error in the @emotion Github issues, leading me to believe the problem was likely on my end.

By downgrading my library's react version to v17 and updating @emotion/[email protected] and @emotion/[email protected], I successfully resolved the issue and now everything is working smoothly once again :)

Answer №7

Experiencing similar issue here! Reverting back to version 11.7.1 resolved the problem!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Modify appearance of Material-UI select component

I am looking for a way to have the select option display the names instead of the values. I want to send the values to the backend but display the names when selected. const names = [ {'name': 'Oliver Hansen', 'id': ...

Passing a service into a directive results in an undefined value

Can someone help me understand why a service I am injecting into a directive is returning undefined in certain instances? If you would like to take a look at the code, here is a plunker link: https://plnkr.co/edit/H2x2z8ZW083NndFhiBvF?p=preview var app = ...

Unveil the Expressjs middleware within the API Client

I am currently developing a Nodejs API Client with the following simple form: //client.js function Client (appId, token) { if (!(this instanceof Client)) { return new Client(appId, token); } this._appId = appId; this._token = tok ...

The issue with Material UI TextField in Appbar is that it has difficulty focusing on the desired area

I'm struggling with maintaining focus on the correct location when utilizing input elements in the application bar. Here is an example: The code snippet can be found below: import { AppBar, CssBaseline, FormControl, Grid, IconBut ...

Issue with Firebase Cloud function not terminating despite receiving a 204 response code

Currently, I am developing a cloud function to manage server operations for a gaming panel. Everything seems to be functioning correctly except that after the request is completed, it fails to trigger the expected "data", "end", or "closed" events which ...

the display outcome appears fuzzy and lacks sharpness

Currently, I am engaged in prototyping and showcasing data in a 3D format using three.js (version 68). The intended outcome of the entire animation is to have a collection of colored spheres representing protons and neutrons, each colored based on a specif ...

The positioning of Material UI InputAdornment icons is located beyond the boundaries of the TextField input area

I am struggling to understand why my InputAdornment is not positioned correctly. There doesn't seem to be any style in my code that would affect the location of the icon within the TextField (such as padding or flex properties). Currently, the calen ...

Issue with kendo grid not properly saving recently added data

Unexpected Grid Behavior: Adding a new record Pressing the update button in the grid for the newly added row Cancelling before saving After completing the above actions, the newly added row disappears. View js fiddle example <!DOCTYPE html> <h ...

Container that displays vertical scroll while permitting floating overflows

Is there a way to set up a container so that when the window size is too small, it displays a scroll bar to view all elements that don't fit in one go? At the same time, can the child containing floating elements be allowed to extend beyond the bounda ...

Issue with window.getSelection() function in Mozilla Firefox

I have implemented code to retrieve the window.getSelection() and assign it to a variable in order to store the current focusNode and offset when the contenteditable div onBlur event is triggered. This functionality works as expected in the Chrome browse ...

What is the process for displaying a list of all files within a folder?

I'm currently working on a project where I have a 'products' directory located in the same folder as my index.html file. My goal is to develop a script that can tally all the jpg files within the 'products' folder and then generate ...

What does the `Class<Component>` represent in JavaScript?

Apologies for the lackluster title (I struggled to think of a better one). I'm currently analyzing some Vue code, and I stumbled upon this: export function initMixin (Vue: Class<Component>) { // ... } What exactly does Class<Component> ...

Unable to retrieve the content of Material UI Textfield

I'm new to React and I need help with my login page that uses Firebase authentication. I have an input field to capture the user's contact information for validation, but I'm having trouble retrieving this data. I've tried various solut ...

Tips for creating a blur effect on all options except for the selected 2 out of 4 using jQuery

My goal is to choose 3 options from a list and once 3 options are selected, all other options will be blurred to prevent further selection. Please review the code snippet I have provided below. Link to File <!DOCTYPE html> <html> <head> ...

Encountering an issue while trying to launch an Angular application on localhost. Vendor.js resource failed to load

Whenever I compile the code, it runs successfully. However, when I try to serve the application using 'node --max-old-space-size=8192', even though it compiles without any errors, when I open the app in a browser, it returns an error saying "Cann ...

The arrangement of imports in NodeJS can lead to unexpected errors

Having an issue with the order in which I include different models in my main server.js file using NodeJS. Below is the code from my product.js Product model file: var mongoose = require("mongoose"); var Dealer = require("./dealer.js") var productSc ...

Attempting to showcase the information in my customized SharePoint Online list through a Web Part Page utilizing AngularJS

<script> //AngularJS Code goes here var appVar = angular.module('listApp', ['ngRoute']); appVar.controller("controller1", function($scope){}); function FetchEmployeeData($scope, EmployeeList){ var reque ...

Is there a way to prevent Express.js from triggering a file download in the browser?

I am attempting to preview a Word document file in the browser using an iframe: <iframe style="float:right;" src="/ViewerJS/#../demo/ohm2013.odp" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe> (Fo ...

Sometimes, JQuery struggles to set input values accurately

Exploring the single page app sample provided here, I have encountered some anomalies when attempting to manipulate input controls with JQuery under certain conditions. Below is the consistent HTML structure followed by the JavaScript snippets in question. ...

Why do identical elements show different scrollHeights when overflowed and how can this discrepancy be resolved?

I am using a plugin that generates a <p> element and continuously fills it with the content from a <textarea>. This plugin positions the <p> directly below the <textarea>, and styles them so that they appear identical in terms of th ...