Skip to content

Conversation

@Janpot
Copy link
Member

@Janpot Janpot commented Jul 29, 2025

Fix codesandbox and parcel without packageExports enabled. The issue is caused by top-level imprts having a cjs and esm variant through main/module fields but the subpath exports only having a cjs export through file system resolution. We can simply remove the module field to have both resolve to the cjs variant. this only applies on runtimes where the exports field is not supported (codesandbox, parcel, webpack@<=4,...).

docs

@Janpot Janpot added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jul 29, 2025
@mui-bot
Copy link

mui-bot commented Jul 29, 2025

Netlify deploy preview

Bundle size report

Bundle Parsed Size Gzip Size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 4c802ff

@Janpot Janpot marked this pull request as ready for review July 29, 2025 15:08
const newPackageData = {
...packageDataOther,
private: false,
...(packageDataOther.main ? { main: './index.js' } : {}),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brijeshb42 this is the line to port to the build tool PR (module property removed).

@Janpot Janpot changed the title [infra] WIP: Remove module field [infra] Remove package.json module field Jul 29, 2025
@Janpot Janpot requested a review from a team July 29, 2025 15:18
@Janpot Janpot merged commit 318f6ff into mui:master Jul 29, 2025
23 checks passed
@zannager zannager changed the title [infra] Remove package.json module field [code-infra] Remove package.json module field Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants