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] npx can't find any codemods #45445

Closed
Maxastuart opened this issue Feb 28, 2025 · 4 comments · Fixed by #45473
Closed

[codemod] npx can't find any codemods #45445

Maxastuart opened this issue Feb 28, 2025 · 4 comments · Fixed by #45473
Assignees
Labels
package: codemod Specific to @mui/codemod regression A bug, but worse

Comments

@Maxastuart
Copy link

Maxastuart commented Feb 28, 2025

Steps to reproduce

Steps:

  1. nvm use 14.18
  2. npx @mui/codemod@next v7.0.0/grid-props src

Current behavior

npx: installed 160 in 5.459s
(node:72946) UnhandledPromiseRejectionWarning: Error: Transform 'v7.0.0/grid-props' not found. Check out /home/max/.npm/_npx/72946/lib/node_modules/@mui/codemod/README.md for a list of available codemods.
    at runJscodeshiftTransform (/home/max/.npm/_npx/72946/lib/node_modules/@mui/codemod/codemod.js:41:13)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:72946) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:72946) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior

readme & package.json say compatible with node >=14.0.0, so I expect the codemod to run in 14.18.3 like all the others

Context

tracked issue to PR #45381 @DiegoAndai @aarongarciah

Your environment

npx @mui/envinfo
  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
  Binaries:
    Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.3/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @mui/base:  5.0.0-beta.69 
    @mui/icons-material: ^7.0.0-beta.2 => 7.0.0-beta.2 
    @mui/lab: ^7.0.0-beta.5 => 7.0.0-beta.5 
    @mui/material: ^7.0.0-beta.2 => 7.0.0-beta.2 
    @mui/private-theming:  7.0.0-beta.2 
    @mui/styles: ^7.0.0-beta.2 => 7.0.0-beta.2 
    @mui/system:  7.0.0-beta.2 
    @mui/utils:  7.0.0-beta.2 
    @mui/x-data-grid:  8.0.0-alpha.12 
    @mui/x-data-grid-premium: ^8.0.0-alpha.12 => 8.0.0-alpha.12 
    @mui/x-data-grid-pro:  8.0.0-alpha.12 
    @mui/x-date-pickers:  6.20.2 
    @mui/x-date-pickers-pro: ^6.20.2 => 6.20.2 
    @types/react: ^16.9.49 => 16.14.5 

Search keywords: codemod grid-props

@Maxastuart Maxastuart added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 28, 2025
@zannager zannager added the package: codemod Specific to @mui/codemod label Mar 3, 2025
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Mar 3, 2025
@DiegoAndai DiegoAndai moved this to Backlog in Material UI Mar 3, 2025
@DiegoAndai DiegoAndai moved this from Backlog to Selected in Material UI Mar 3, 2025
@DiegoAndai
Copy link
Member

DiegoAndai commented Mar 3, 2025

Thanks for the report @Maxastuart, this is a bug. It doesn't only affect node 14 and v7.0.0/grid-props, but all node versions and all codemods. I opened a PR to fix it ASAP, see the explanation for the bug there.

@DiegoAndai DiegoAndai changed the title Codemod @next v7.0.0/grid-props doesn't work, npx says doesn't even exist [codemod] npx can't find any codemods Mar 3, 2025
@DiegoAndai DiegoAndai added regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 3, 2025
@DiegoAndai DiegoAndai moved this from Selected to In progress in Material UI Mar 3, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Material UI Mar 3, 2025
Copy link

github-actions bot commented Mar 3, 2025

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@Maxastuart How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@DiegoAndai
Copy link
Member

The fix will be availabe in the next v7 prerelease (>7.0.0-beta.2)

@DiegoAndai
Copy link
Member

The fix is available in version 7.0.0-beta.3

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 regression A bug, but worse
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants