conventional-changelog / commitlint

📓 Lint commit messages
https://commitlint.js.org
MIT License
16.89k stars 908 forks source link

fix: Did you mean to import "cosmiconfig-typescript-loader/dist/cjs/index.cjs"? #4093

Open marafat opened 4 months ago

marafat commented 4 months ago

Steps to Reproduce

1. Upgrade from v18 to v19 
2. run `git cz`

Current Behavior

Error:

$ git cz
cz-cli@4.3.0, @commitlint/cz-commitlint@19.2.0

Cannot find module '<project_local_path>/node_modules/cosmiconfig-typescript-loader/dist/esm/index.mjs' imported from <project_local_path>/node_modules/@commitlint/load/lib/utils/load-config.js
Did you mean to import "cosmiconfig-typescript-loader/dist/cjs/index.cjs"?

Expected Behavior

Prompt to load and allow commiting.

Affected packages

Possible Solution

No response

Context

package.json before:

"devDependencies": {
    "@commitlint/cli": "18.6.1",
    "@commitlint/config-conventional": "18.6.2",
    "@commitlint/cz-commitlint": "18.6.1",
    "commitizen": "4.3.0",
}

package.json after:

"devDependencies": {
    "@commitlint/cli": "19.3.0",
    "@commitlint/config-conventional": "19.2.2",
    "@commitlint/cz-commitlint": "19.2.0",
    "commitizen": "4.3.0",
}

Config file commitlint.config.cjs

commitlint --version

@commitlint/cli@19.3.0

git --version

git version 2.39.3 (Apple Git-146)

node --version

v20.14.0

escapedcat commented 4 months ago

Hm, which version of cosmiconfig-typescript-loader have you installed?

marafat commented 4 months ago

In my yarn.lock I have "cosmiconfig-typescript-loader@npm:^5.0.0": which is set as a dependency on @commitlint/load@19.2.0