1: text**
While attempting to implement the Appbar component from Material UI, I encountered an unexpected error.
1: text**
While attempting to implement the Appbar component from Material UI, I encountered an unexpected error.
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.
Using npm to install @mui/[email protected] along with @emotion/[email protected] and @emotion/[email protected] can solve many issues...
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
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.)
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>
.
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 🚀
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 :)
Experiencing similar issue here! Reverting back to version 11.7.1 resolved the problem!
When working with mongoose to store user data, one of the attributes is an array called items. In my additems.js file: const User = require('../models/User'); var array = user.items; array.indexOfObject = function (property, value) { ...
I'm puzzled by the error message I'm receiving: [commonjs--resolver] Unexpected character '�' (Note that you need plugins to import files that are not JavaScript) file: /..../..../WebProjects/..../ProjectName/node_modules/fsevents/fse ...
Introduction: I have explored similar inquiries and attempted to apply relevant code/concepts but without success. -https://stackoverflow.com/questions/43645790/passing-javascript-variable-to-python-flask -https://stackoverflow.com/questions/10313001/is- ...
Check out the code snippet below: MyObject.prototype.doIt = function() { let a = this.obj1; let b = this.obj2; } I need to find a way to switch the values of this.obj1 and this.obj2, making obj1 take on the value of obj2 and vice versa. Pleas ...
I am attempting to populate an array with objects in order to achieve the following structure: myobject1: Object: ItemInside: Object myobject2: Object ItemInside: Object myobject3: Object ItemInside: Object myobject4: Object ItemInside: Ob ...
I'm currently working on a react application that utilizes Material UI. I've been able to successfully set the theme's default background color on the body, but now I'm interested in setting a background image instead. Can anyone provid ...
Can anyone assist me with this query? I have a drop-down menu that includes "Shop A" and "Shop B". Shop A has a value of 1, and Shop B has a value of 2. When I select Shop A from the dropdown, I want to display the data from the database as a table specifi ...
I stumbled upon an interesting jquery script that allows for a collapsible sub menu within a list. After implementing this code: $('.menu-item-has-children').prepend('<a id="fa-menu" href="#"><i class="fa fa-plus"></i>< ...
https://i.stack.imgur.com/gTKzT.png I'm dealing with a sign out component in my app that requires me to click on it specifically to unselect any part of the application. This is implemented using React Material UI. <MenuItem onClick={e => this ...
We manage over 10 production servers and each time we update our dependencies, performing a clean installation seems more controlled but also slower. The issue is that the devops team is concerned about the time it takes to perform a clean npm install aft ...
I am attempting to use jQuery and AJAX to submit a form in order to add a row to a table called cadreSante (which is in French). The code I am using for this operation is provided below. Can someone please identify any errors in the code and suggest ways t ...
I am trying to set a background image from a local source on my computer. Below are two lines of code, one that works and one that does not: (the local one fails) _html.style.backgroundImage = 'url("urlsourceblahblahblah")'; _html.style.backgro ...
I'm currently working on incorporating a Material UI table to showcase content with just one row per page. After successfully loading the page and displaying the first row, I encountered an issue where navigating to subsequent pages does not render a ...
My chat application is not allowing me to post multiple messages. Here is the code snippet responsible for sending messages: window.typing = false; var posted = 0; var canPost = 1; var donotrefresh = 0; document.forms['send'].addEventListener(& ...
Here is the React code I have written: getDetails: function () { var apiUrl = ConfigStore.get('api') request .get(apiUrl) .set('X-Auth-Token', AuthStore.jwt) .set('Accept&apo ...
Using Django REST framework for the backend, I am attempting to authenticate requests in Angular by including a token in the request headers. However, Angular does not seem to be sending any header values. Despite trying various methods to add headers to ...
Below is the code and script that I have: <template> <div class="tasks_container"> <div class="tasks_content"> <h1>Tasks</h1> <ul class="tasks_list"> ...
I'm facing an issue with dispatching a custom event called "select-date" from a custom web component date picker to a React functional component. Despite testing, the event doesn't seem to be reaching the intended component as expected. Below is ...
I encountered an error code while working with AngularJS to create a countdown timer. Can someone please assist me? //Rounding the remainders obtained above to the nearest whole number intervalinsecond = (intervalinsecond < 10) ? "0" + intervalinseco ...
Currently, my Express server is up and running and it's set to send an HTML file from the public folder of my project. The issue arises when I try to initiate a request from a client script linked in this HTML file to send data back to the server. Des ...