-
Notifications
You must be signed in to change notification settings - Fork 926
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
fix: Error [ERR_REQUIRE_ESM]: require() of ES Module #3842
Comments
Can you create a minimal repo for reproduction? I know you tried node v18, but just fyi: only even versions are the real production ones |
Hi @escapedcat , thank you for your response. Sure, here's the repo |
Thanks, yeah, weird. yarn test
yarn run v1.22.21
warning package.json: No license field
$ jest
PASS app/Button.test.tsx
Button
✓ renders Button component (13 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.481 s, estimated 1 s
Ran all test suites.
✨ Done in 1.84s.
node -v
v18.19.0 Not sure why this is happening tbh. |
Yea.. that is what i observed as well. But, i cannot do these in Ci/CD every time. Plus, if you delete node_modules and then try to run yarn install --frozen-lockfile you will get same issue every time |
True, not sure how to fix this. |
Thanks for the help anyway. Maybe someone from the community had the same issue and solved somehow. |
Yeah, if this happens more often, people will at least find this issue. Thanks for raising! |
It also happens for me, upgrading from |
Hm, which change could have caused this? |
No one has a fix? Not even maintainers? 😢 |
Does this duplicate or relate to #3642? |
Yes, same thing. |
Commitizen is currently generating errors due to ES Module/CommonJS incompatibilities described by the following GitHub issue: conventional-changelog/commitlint#3842 This change implements the temporary workaround described by the issue. Change-Id: Idb74a3366bf046a0c9bac83380de904c5c059087 Signed-off-by: Chris Kay <chris.kay@arm.com>
Expected Behavior
Should work i guess?
Current Behavior
Right now , when i run
yarn install --frozen-lockfile
and then try to test it with Jest for example, i got this issue:But, if I run yarn install is working fine.
I use frozen-lockfile for Docker & CI/CD pipelines
I tried also to downgrade the node version to 18. And tried to downgrade the package to a smaller version but still got the issue.
I know that is saying something about string-width & cliui. But I run npm ls string-width / cliui, i got:
@commitlint/cli@18.4.4
└─┬ yargs@17.7.2
└── cliui@8.0.1
Also, this package is scoped to project and is NOT a global install
Affected packages
Possible Solution
No response
Steps to Reproduce
run yarn install --frozen-lockfile run npx jest test or npx commitlint --config .commintlintrc.cjs
Context
No response
commitlint --version
18.4.4
git --version
v2.39.3
node --version
v21.1.0
The text was updated successfully, but these errors were encountered: