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

fix: error TS2307: Cannot find module 'conventional-commits-parser' or its corresponding type declarations. #3942

Closed
1 of 4 tasks
knocte opened this issue Feb 28, 2024 · 6 comments · Fixed by #3944
Closed
1 of 4 tasks
Labels

Comments

@knocte
Copy link
Contributor

knocte commented Feb 28, 2024

Expected Behavior

Should compile (like it was compiling 2 days ago).

Current Behavior

node_modules/@commitlint/types/lib/lint.d.ts(1,30): error TS2307: Cannot find module 'conventional-commits-parser' or its corresponding type declarations.
node_modules/@commitlint/types/lib/parse.d.ts(1,38): error TS2307: Cannot find module 'conventional-commits-parser' or its corresponding type declarations.
node_modules/@commitlint/types/lib/rules.d.ts(1,29): error TS2307: Cannot find module 'conventional-commits-parser' or its corresponding type declarations.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Steps to Reproduce

  1. Have some commitlint plugins in a repo.
  2. Install @commitlint/types package via npm install --verbose @commitlint/types
    Log:
npm verb cli /usr/bin/node /usr/bin/npm
npm info using npm@9.2.0
npm info using node@v18.13.0
npm verb title npm install @commitlint/types
npm verb argv "install" "--loglevel" "verbose" "@commitlint/types"
npm verb logfile logs-max:10 dir:/github/home/.npm/_logs/2024-02-28T09_22_20_081Z-
npm verb logfile /github/home/.npm/_logs/2024-02-28T09_22_20_081Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/@commitlint%2ftypes 122ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/chalk 22ms (cache miss)
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 53ms
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-6.3.1.tgz 54ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz 60ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@commitlint/types/-/types-19.0.0.tgz 80ms (cache miss)

added 2 packages, changed 1 package, and audited 301 packages in 1s

34 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm verb exit 0
npm info ok
  1. Try to compile with tsc

Context

No response

commitlint --version

19.0.0

git --version

2.40.1

node --version

18.13.0

@knocte knocte added the bug label Feb 28, 2024
@escapedcat
Copy link
Member

Also happens with latest version?

@knocte
Copy link
Contributor Author

knocte commented Feb 28, 2024

Also happens with latest version?

I'm not pinning to a specific old version, so it's always installing the last. And the last time my CI ran was 5 mins ago. So: yes.

@knocte
Copy link
Contributor Author

knocte commented Feb 28, 2024

I'm trying to find what went wrong here, and I've found this npm pkg: conventional-commits-parser. How is it possible that last version of it (see https://www.npmjs.com/package/conventional-commits-parser?activeTab=versions) was 6 months ago? Last commits of it are not being released?

@escapedcat
Copy link
Member

Is this PR related? #3929
Was waiting till this major version settles till merghing dep PRs again.

@JounQin
Copy link
Contributor

JounQin commented Feb 28, 2024

We only use @types/conventional-commits-parser as devDependency for its types, for TypeScript users, they may have to install @types/conventional-commits-parser by themselves. Maybe we should mark it as dependency instead for @commitlint/types considering it's only for typings.

@escapedcat
Copy link
Member

knocte added a commit to nblockchain/conventions that referenced this issue Mar 12, 2024
The last version of commitlint is making our tests fail. My
suspicions for why are the following:

a) After their massive refactoring migrating to ESM [1], they
somehow changed their sub-package @commitlint/types, which I
reported as bug 3942 [2].

b) When fixing bug 3942 [3], they updated their dependency to
`@types/conventional-commits-parser` to a higher version (from
3.0.6 to 5.0.0). Version 5.0.0 of that package is about 18
days old, however, version 5.0.0 of package
`conventional-commits-parser` [4] is 6 months old! But the
worst is that the previous version 3.0.6 (which is the one
that commitlint was using before this update) was published
about 4 years ago! So I'm guessing our plugins were compatible
with very old versions of this internal component and now its
update has exposed bugs.

[1] conventional-changelog/commitlint@3423735
[2] conventional-changelog/commitlint#3942
[3] conventional-changelog/commitlint@5a01f59
[4] https://www.npmjs.com/package/conventional-commits-parser
knocte added a commit to nblockchain/conventions that referenced this issue Mar 12, 2024
The last version of commitlint is making our tests fail. My
suspicions for why are the following:

* After their massive refactoring migrating to ESM [1], they
somehow changed their sub-package @commitlint/types, which I
reported as bug 3942 [2].

* When fixing bug 3942 [3], they updated their dependency to
`@types/conventional-commits-parser` to a higher version (from
3.0.6 to 5.0.0). Version 5.0.0 of that package is about 18
days old, however, version 5.0.0 of package
`conventional-commits-parser` [4] is 6 months old! But the
worst is that the previous version 3.0.6 (which is the one
that commitlint was using before this update) was published
about 4 years ago! So I'm guessing our plugins were compatible
with very old versions of this internal component and now its
update has exposed bugs.

[1] conventional-changelog/commitlint@3423735
[2] conventional-changelog/commitlint#3942
[3] conventional-changelog/commitlint@5a01f59
[4] https://www.npmjs.com/package/conventional-commits-parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants