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

@commitlint/[email protected] throws on load of javascript config missing ts-node #3347

Closed
1 of 4 tasks
subdiff opened this issue Aug 27, 2022 · 6 comments · Fixed by #3351
Closed
1 of 4 tasks

@commitlint/[email protected] throws on load of javascript config missing ts-node #3347

subdiff opened this issue Aug 27, 2022 · 6 comments · Fixed by #3351

Comments

@subdiff
Copy link

subdiff commented Aug 27, 2022

Running commitlint with a js config fails for me since today on CI as the load module needs ts-node package, but doesn't find it. I can reproduce it locally.

Expected Behavior

Expected to be able to run commitlint on configs without typescript and without installing additional packages manually.

Current Behavior

Loader fails to run, requires to install ts-node manually.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

@escapedcat
Copy link
Member

escapedcat commented Aug 28, 2022

This was introduced with updating cosmiconfig-typescript-loader/releases:
https://github.com/Codex-/cosmiconfig-typescript-loader/releases/tag/3.0.0

We need the ts-loader for this: https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/load/src/utils/load-config.ts#L30-L36

The ts-node dependency has been discussed here as well: #3221
Now the problem is very transparent.

Not sure how to deal with this best. Happy for feedback, suggestions, PRs.

Easiest way might just be to re-add it as a dep and push out a new version.

@Harukisatoh
Copy link

Is there any workaround that we can do for now while the package is not updated yet?

@subdiff
Copy link
Author

subdiff commented Aug 28, 2022

Is there any workaround that we can do for now while the package is not updated yet?

You should be able to make it work by installing the ts-node package manually.

@subdiff
Copy link
Author

subdiff commented Aug 28, 2022

Not sure how to deal with this best. Happy for feedback, suggestions, PRs.

Is it possible that commitlint only tries to find the ts-node module when reading a typescript config and otherwise not even looks for it?

@Harukisatoh
Copy link

Is there any workaround that we can do for now while the package is not updated yet?

You should be able to make it work by installing the ts-node package manually.

Thanks man. But I preferred to just downgrade the lib to v16.3.0 for now as my project is not a Typescript one.

@escapedcat
Copy link
Member

Fixed with: https://github.com/conventional-changelog/commitlint/releases/tag/v17.1.2
Thanks @filiptammergard !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants