Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 shows a warning with webpack when not using with React 18 #351

Closed
ahayes91 opened this issue Jun 20, 2022 · 3 comments
Closed

v5 shows a warning with webpack when not using with React 18 #351

ahayes91 opened this issue Jun 20, 2022 · 3 comments

Comments

@ahayes91
Copy link

We tried updating to v5 today, functionally all is fine, but we are seeing a build warning locally:

WARNING in ./node_modules/react-accessible-accordion/dist/es/index.js 548:16-21
export 'useId' (imported as 'useId') 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)

webpack 5.22.0 compiled with 1 warning in 12733 ms

I don't have a reproduction repository at the moment unfortunately, but can confirm we are on React 16.13.1 (currently in the process of updating to React 17).

A very similar issue happened recently over in material-ui too - mui/material-ui#29860
Looks like this warning is a webpack limitation (webpack/webpack#14814).

Interestingly, it seems like the MUI folks decided to roll back the useId changes until React 18 is released (because they don't need them right now for React 18 experimentation).
mui/material-ui#29860 (comment)

For the moment we're going to stick with v4 to avoid the noise.
Feel free to close this issue if this project's priority is getting compatibility with React 18 sooner rather than later - just wanted to raise this with you folks to get a bit of traction with the webpack fix, and to give you a heads up about the MUI approach.
Thanks!

@ElijahPrince73
Copy link

Having the same issue on react 17.0.2

@synecdokey
Copy link
Contributor

V5 is a release we cut explicitly for React 18 support (Hence the major upgrade, this was a breaking change, the webpack fix would not work as we are using React 18 new APIs), we are sticking with V4 for React 17 and under compatibility, using V4 has no functional difference outside of React version compatibility.

@zopelee
Copy link

zopelee commented Jun 24, 2024

V5 is a release we cut explicitly for React 18 support (Hence the major upgrade, this was a breaking change, the webpack fix would not work as we are using React 18 new APIs), we are sticking with V4 for React 17 and under compatibility, using V4 has no functional difference outside of React version compatibility.

@synecdokey

mui v4 doesn't play well with vite build (vite 5.3.1).
After vite build, many v4 components' styles are broken, such as <Fab />.
And v4 also seems to be broken with parcel build (ref)

In short:
To build in vite/parcel, you need to upgrade to mui v5.
To upgrade to mui v5, you need to upgrade to react 18.
What a ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants