-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Version 11.11.0 introduces breaking change in builds. #3032
Comments
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. |
In using 11.11.0 saw the following build error |
At MUI, we're also having a hard time upgrading to 11.11.0. It manifests itself in a pretty weird way, claiming that one of our functions is not a function: https://app.netlify.com/sites/material-ui/deploys/646362611ccf2300088a7a54#L111 After some digging and pulling a few hairs, I managed to figure out that webpack (used by Next.js) now treats our createSvgIcon function as a dynamic dependency, because some of its transitive dependencies are dynamic. I traced the dependencies back to Emotion and realized webpack now imports them differently than before. /***/ 553139:
/***/ ((module) => {
module.exports = require("@emotion/react");;
/***/ }), and now is /***/ 553139:
/***/ ((module) => {
module.exports = import("@emotion/react");;
/***/ }), (these snippets are from next.js built pages) This makes me believe #3029 may cause a problem here. |
@michaldudak could we jump on a call tomorrow to go through this? |
A minimal reproduction of the general problem: https://github.com/emmatown/test-next-esm. Note the result of the logs, in the pages dir only one during server rendering, it's a promise It's to do with Next's esm externals stuff, the problem doesn't occur in the app dir or in the pages dir when there's an app dir (because in the app dir, nearly everything is bundled so The code to look at in Next seems to be around https://github.com/vercel/next.js/blob/9e5116975d770e84024d0291e8e0422d7a59ee5e/packages/next/src/build/webpack-config.ts#L527. imo, this is very much "Next is doing a problematic thing here" and Next should probably change, not Emotion. Adding a |
Thanks for the detailed investigation, @emmatown! |
hello,
|
Current behavior:
To reproduce:
Upgraded from
to
When running build now fails with the following error
react
version: 18.2.0The text was updated successfully, but these errors were encountered: