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 v5 error with core js #29871

Closed
2 tasks done
sibelius opened this issue Nov 24, 2021 · 2 comments
Closed
2 tasks done

codemod v5 error with core js #29871

sibelius opened this issue Nov 24, 2021 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists package: codemod Specific to @mui/codemod

Comments

@sibelius
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Running the codemod does not works

npx codemod v5.0.0/preset-safe packages/**/src

it throws this error

Error: Cannot find module 'core-js/modules/es.object.define-property.js'
Require stack:

  • node_modules/@mui/codemod/node/v5.0.0/preset-safe.js
  • node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js

Expected behavior 🤔

Running the codemod works

Steps to reproduce 🕹

Steps:

  1. npx codemod v5.0.0/preset-safe packages/**/src

Context 🔦

I'm getting this error

Error: Cannot find module 'core-js/modules/es.object.define-property.js'
Require stack:
- @mui/codemod/node/v5.0.0/preset-safe.js
- @mui/codemod/node_modules/jscodeshift/src/Worker.js

Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@sibelius sibelius added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 24, 2021
@sibelius
Copy link
Author

after trying to install core-js globally

I've got this new error:

/.nvm/versions/node/v16.13.0/lib/node_modules/core-js/modules/es.global-this.js:9
$({
^

TypeError: $ is not a function
    at Object.<anonymous> (/.nvm/versions/node/v16.13.0/lib/node_modules/core-js/modules/es.global-this.js:6:1)

@siriwatknp siriwatknp added the package: codemod Specific to @mui/codemod label Nov 26, 2021
@siriwatknp
Copy link
Member

duplicate of #28499

Please see the workaround #28499 (comment)

@siriwatknp siriwatknp added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists package: codemod Specific to @mui/codemod
Projects
None yet
Development

No branches or pull requests

2 participants