Skip to content

fix: not working in yarn 4 pnp #3752

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

Closed
1 of 4 tasks
0xHexE opened this issue Nov 10, 2023 · 6 comments
Closed
1 of 4 tasks

fix: not working in yarn 4 pnp #3752

0xHexE opened this issue Nov 10, 2023 · 6 comments
Labels

Comments

@0xHexE
Copy link

0xHexE commented Nov 10, 2023

Expected Behavior

Should lint the commit message

Current Behavior

yarn commitlint --edit $1
/home/user/workspace/project/.yarn/cache/@commitlint-cli-npm-18.4.0-d320f2e322-e23220a58f.zip/node_modules/@commitlint/cli/lib/cli.js:123
        throw err;
        ^
TypeError: Cannot read properties of undefined (reading '.cjs')
    at getDynamicAwaitConfig (/home/user/workspace/project/.yarn/cache/@commitlint-load-npm-18.4.0-188370ee62-c84655f211.zip/node_modules/@commitlint/load/lib/utils/load-config.js:73:53)
    at loadConfig (/home/user/workspace/project/.yarn/cache/@commitlint-load-npm-18.4.0-188370ee62-c84655f211.zip/node_modules/@commitlint/load/lib/utils/load-config.js:19:73)
    at load (/home/user/workspace/project/.yarn/cache/@commitlint-load-npm-18.4.0-188370ee62-c84655f211.zip/node_modules/@commitlint/load/lib/load.js:19:55)
    at main (/home/user/workspace/project/.yarn/cache/@commitlint-cli-npm-18.4.0-d320f2e322-e23220a58f.zip/node_modules/@commitlint/cli/lib/cli.js:189:45)
Node.js v19.9.0
husky - commit-msg hook exited with code 1 (error)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Steps to Reproduce

1. Setup project with yarn4 and enable pnp.
2. Try to run cli

Context

No response

commitlint --version

@commitlint/[email protected]

git --version

v2.41.0

node --version

v19.9.0

@joberstein
Copy link
Contributor

@0xHexE I linked a pull request for this that I believe is related; what does yarn why cosmiconfig give you? If it's less than 8.2.0, the PR should fix it.

@0xHexE
Copy link
Author

0xHexE commented Nov 11, 2023

├─ @commitlint/load@npm:18.4.0
│  └─ cosmiconfig@npm:8.1.3 (via npm:^8.0.0)

🤞🏽

@joberstein
Copy link
Contributor

├─ @commitlint/load@npm:18.4.0
│  └─ cosmiconfig@npm:8.1.3 (via npm:^8.0.0)

🤞🏽

In the meantime you can update the dependency in your lockfile to point to 8.3.6 to resolve this.

@0xHexE
Copy link
Author

0xHexE commented Nov 11, 2023

It worked! Thanks a lot for your help.

@escapedcat
Copy link
Member

@0xHexE
Copy link
Author

0xHexE commented Nov 12, 2023

Perfect it fixes the issue. Thank a lot.

yarn.lock

"@commitlint/load@npm:^18.4.1":
  version: 18.4.1
  resolution: "@commitlint/load@npm:18.4.1"
  dependencies:
    "@commitlint/config-validator": "npm:^18.4.0"
    "@commitlint/execute-rule": "npm:^18.4.0"
    "@commitlint/resolve-extends": "npm:^18.4.0"
    "@commitlint/types": "npm:^18.4.0"
    "@types/node": "npm:^18.11.9"
    chalk: "npm:^4.1.0"
    cosmiconfig: "npm:^8.3.6"
    cosmiconfig-typescript-loader: "npm:^5.0.0"
    lodash.isplainobject: "npm:^4.0.6"
    lodash.merge: "npm:^4.6.2"
    lodash.uniq: "npm:^4.5.0"
    resolve-from: "npm:^5.0.0"
  checksum: 77cb8b02c39fd0a28214cea898811100b1b0c33047914a9294df862ad0c75965b3000ddb1806a5e89054141ce5217419b419d5d3d9bcf757e904f34b530d7474
  languageName: node
  linkType: hard
├─ @commitlint/load@npm:18.4.1
│  └─ cosmiconfig@npm:8.3.6 [45de4] (via npm:^8.3.6 [45de4])

@0xHexE 0xHexE closed this as completed Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants