Dependencies with exports
field break on pages router with esmExternals: false
#65056
Labels
exports
field break on pages router with esmExternals: false
#65056
Link to the code that reproduces this issue
https://github.com/DiegoAndai/esm-test-13-nextjs-pages-mui-exports-ts
To Reproduce
npm install
npm run dev
http://localhost:3000
in the browserDescription
We're trying to add the
exports
field to thepackage.json
of MUI core libraries (PR | Docs).This app is using the MUI libraries from the PR build (e.g., https://pkg.csb.dev/mui/material-ui/commit/fb7a4ff2/@mui/material).
When testing the libraries on a Next.js app with pages router and
esmExternals: false
, we get the following error:Full error
This seems related to default import/export interop between esm and cjs: https://www.typescriptlang.org/docs/handbook/modules/appendices/esm-cjs-interop.html
The expected is for the app to run without erroring.
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 Available memory (MB): 16384 Available CPU cores: 16 Binaries: Node: 18.19.0 npm: 10.4.0 Yarn: 1.22.21 pnpm: 8.14.1 Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: 14.2.3 react: 18.3.0 react-dom: 18.3.0 typescript: 5.4.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
14.2.3
,13.5.1
, and13.4.0
.The text was updated successfully, but these errors were encountered: