You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. First step
https://github.com/timonmasberg/commitlint-nx-bug
2. Second step
`git commit -m "chore: oh no"`
Current Behavior
Throws an error, probably due to the ESM changes introduced in v19.
file:///.../commitlint-nx-19/node_modules/@commitlint/cli/lib/cli.js:127
throw err;
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../commitlint-nx-19/node_modules/nx/src/generators/utils/project-configuration' imported from.../commitlint-nx-19-bug/commitlint-nx-19/node_modules/@commitlint/config-nx-scopes/index.js
Did you mean to import .../commitlint-nx-19/node_modules/nx/src/generators/utils/project-configuration.js?
at finalizeResolution (node:internal/modules/esm/resolve:255:11)
at moduleResolve (node:internal/modules/esm/resolve:908:10)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///.../commitlint-nx-19/node_modules/nx/src/generators/utils/project-configuration'
}
Expected Behavior
It should be able to get the configuration and lint the message.
Steps to Reproduce
1. First step https://github.com/timonmasberg/commitlint-nx-bug 2. Second step `git commit -m "chore: oh no"`
Current Behavior
Throws an error, probably due to the ESM changes introduced in v19.
Expected Behavior
It should be able to get the configuration and lint the message.
Affected packages
Possible Solution
Adding file extensions to nx imports (https://nodejs.org/api/esm.html#esm_mandatory_file_extensions)
Context
Migrating to NX 18, bumped commitlint packages manually, error encountered. Probably not related to nx, rather than how you use the nx modules.
commitlint --version
@commitlint/[email protected]
git --version
2.39.2
node --version
20.10.0
The text was updated successfully, but these errors were encountered: