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

regression: Pnpm wrap-ans require() of ES Module error #996

Open
MengLinMaker opened this issue Sep 1, 2024 · 0 comments
Open

regression: Pnpm wrap-ans require() of ES Module error #996

MengLinMaker opened this issue Sep 1, 2024 · 0 comments

Comments

@MengLinMaker
Copy link

MengLinMaker commented Sep 1, 2024

Description

cz-cli dependency wrap-ans does not import properly, causing error when running pnpm commit

package.json

{
  "type": "module",
  "scripts": {
      "commit": "cz",
      ...
    },
    ...
}

error in cli

require() of ES Module /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/node_modules/string-width/index.js from /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/index.js not supported.
Instead change the require of /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/node_modules/string-width/index.js in /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/index.js to a dynamic import() which is available in all CommonJS modules.

Note: using "type": "commonjs" leads to the same result

Additional details

This issue only occurs on [email protected] and after.
I found [email protected] to behave exactly how I liked.

@MengLinMaker MengLinMaker changed the title Pnpm wrap-ans require() of ES Module error regression: Pnpm wrap-ans require() of ES Module error Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant