Skip to content

[docs] Codemod breaks upon missing modules #45981

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

Open
RobbieS82 opened this issue Apr 22, 2025 · 1 comment
Open

[docs] Codemod breaks upon missing modules #45981

RobbieS82 opened this issue Apr 22, 2025 · 1 comment
Labels
package: codemod Specific to @mui/codemod status: waiting for author Issue with insufficient information

Comments

@RobbieS82
Copy link

RobbieS82 commented Apr 22, 2025

Related page

https://mui.com/material-ui/migration/migration-v4/

Kind of issue

Other

Issue description

When I run the codemod Run the migrator: npx @mui/codemod@latest v5.0.0/preset-safe . I am met with the following error:

Error: Cannot find module '@material-ui/core/es/colors'
Require stack:
- C:\Users\613296\AppData\Local\npm-cache\_npx\2aacf93ee2439f59\node_modules\@mui\codemod\v5.0.0\optimal-imports.js
- C:\Users\613296\AppData\Local\npm-cache\_npx\2aacf93ee2439f59\node_modules\@mui\codemod\v5.0.0\preset-safe.js

I verified the two javascript files (optimal-imports.js and preset-safe.js) are present.
Not sure if this means the conversion failed or if the codemod worked.

Context

I inherited a react webapp at work, and it is outdated. I'm trying to get it to install and build, but the @material-ui libraries were causing a lot of trouble. So I am trying to upgrade them.

Search keywords: cannot find module optimal-imports preset-safe

@RobbieS82 RobbieS82 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Apr 22, 2025
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Apr 23, 2025

Please share a minimal repro on GitHub so we can debug it—just the error message isn’t enough.

Also, consider upgrading to v6 or v7 since v5 is no longer actively maintained.

@ZeeshanTamboli ZeeshanTamboli added status: waiting for author Issue with insufficient information package: codemod Specific to @mui/codemod and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: codemod Specific to @mui/codemod status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants