[material-ui] Next.js 14 with NX monorepo build fails on PonyfillGlobal #41871
Labels
nextjs
package: material-ui
Specific to @mui/material
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
Link to live example: (nextjs error repo)
Steps:
npm i
npx nx build nx-nextjs-monorepo
Current behavior
Getting an error:
Also saw this error when using
mui
pervious version5.15.14
:Expected behavior
That error will not appear, and fix the code that causes the issue.
Context
When trying to setup a NX monorepo with NextJS 14 (App Router), I have exported from my libs folder some middleware(s) and then when running the build command I get this error (see above).
After I further investigated I saw that it has something to deal with this file: https://github.com/mui/material-ui/blame/next/packages/mui-utils/src/ponyfillGlobal/ponyfillGlobal.ts
Whenever I changed it locally in my
node_modules
to just returnthis
instead ofFunction('return this')
the build started to work fine again. I am not sure on the cause of this.Your environment
npx @mui/envinfo
Search keywords: ponyfillglobal
The text was updated successfully, but these errors were encountered: