-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[core] True ESM support #43938
Comments
for v7 I'd like to go to dual mode packages with exports field and a single layout that's the same across all packages. Personally I think if we go ESM only with one package we should do it for all. The less we confuse bundlers, the better 🙂 |
That makes sense 👍🏼 |
Idk whether the following issue is considered expected, as it's an alpha version. import zIndexMui from "@mui/material/styles/zIndex" the following error happens: The module "./esm/styles/zIndex/index.js" was not found on the file system:
../node_modules/@mui/material/package.json:95:19:
95 │ "default": "./esm/*/index.js"
╵ ~~~~~~~~~~~~~~~~~~ As I understand it, the issue is due to either:
The released node_modules/@mui/material/esm/styles/zIndex.js |
It is expected, we don't consider subpath imports more than one level deep part of our public API. v7 will more strongly enforce that. We're documenting this in the upcoming migration guide. As for your use-case, I suppose our intention would be to read the default z-index from the default theme. import { createTheme } from '@mui/material/styles'
const { zIndex } = createTheme() cc @siriwatknp would it make sense to separately export the default z-index from We could also more explicitly define our exports in package.json instead of using the wildcard |
not sure if it is expected, but @mui/icons-material v7 beta.2 does not find the types with moduleResolution:node(?) example https://stackblitz.com/edit/react-vjasx57o?file=Demo.tsx screenshot i see similar error with a local project as the stackblitz too Example error I see locally
|
Fixing it in #45444 |
Steps to reproduce
I'm creating this issue as an umbrella to solve ESM support in Material UI v7.
What does success looks like?
We close those issues
exports
to the package.json #26254className
did not match” error #43980@mui/icons-material
throws error in Remix/Vite #44265useTheme
doesn't reflect custom theme values when used with Remix SSR setup #31233exports
inpackage.json
for ESM support #45495Likely same root cause
in other projects (post stable release):
(post stable release) https://github.com/wooorm/npm-esm-vs-cjs/blob/c0a92334da4979f7614143734bbe7931d2a0dcde/data/2024-08-28.json#L2626 is no longer flagged as "faux" but "dual", see their legend description.
Current behavior
No response
Expected behavior
No response
Context
No response
Your environment
npx @mui/envinfo
Search keywords: -
The text was updated successfully, but these errors were encountered: