Skip to content
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

Codemod errors on object containing MuiDivider property #43109

Closed
Janpot opened this issue Jul 29, 2024 · 2 comments · Fixed by #43125
Closed

Codemod errors on object containing MuiDivider property #43109

Janpot opened this issue Jul 29, 2024 · 2 comments · Fixed by #43125
Assignees
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod

Comments

@Janpot
Copy link
Member

Janpot commented Jul 29, 2024

Steps to reproduce

Link to live example: https://stackblitz.com/edit/stackblitz-starters-uqqkp5

Steps:

  1. Create a file containing console.log({ MuiDivider: {} });
  2. Run npx @mui/codemod@next deprecations/all <path> (Or npm run codemod in the stackblitz)

Current behavior

TypeError: Cannot read properties of undefined (reading 'value')
    at NodePath.eval (/home/.npm/_npx/7ce9e72bb3a1a4a2/node_modules/@mui/codemod/node/deprecations/divider-props/divider-props.js:63:42)
    at eval (/home/.npm/_npx/7ce9e72bb3a1a4a2/node_modules/jscodeshift/src/Collection.js:75:36)
    at Array.forEach (<anonymous>)
    at Collection.forEach (/home/.npm/_npx/7ce9e72bb3a1a4a2/node_modules/jscodeshift/src/Collection.js:74:18)
    at transformer (/home/.npm/_npx/7ce9e72bb3a1a4a2/node_modules/@mui/codemod/node/deprecations/divider-props/divider-props.js:60:6)
    at deprecationsAll (/home/.npm/_npx/7ce9e72bb3a1a4a2/node_modules/@mui/codemod/node/deprecations/all/deprecations-all.js:46:42)

Expected behavior

No error

Context

Trying migration in Toolpad Studio

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: MuiDivider codemod

@Janpot Janpot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 29, 2024
@mnajdova mnajdova added bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 30, 2024
@siriwatknp siriwatknp assigned DiegoAndai and unassigned siriwatknp Jul 31, 2024
@siriwatknp
Copy link
Member

@DiegoAndai Can you help with this one?

@Janpot
Copy link
Member Author

Janpot commented Jul 31, 2024

Took care of it in #43125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants