-
Notifications
You must be signed in to change notification settings - Fork 906
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
bug: [readCachedProjectGraph] ERROR: No cached ProjectGraph is available after upgrading to NX v17.2.0 (@commitlint/config-nx-scopes
)
#3820
bug: [readCachedProjectGraph] ERROR: No cached ProjectGraph is available after upgrading to NX v17.2.0 (@commitlint/config-nx-scopes
)
#3820
Comments
@commitlint/config-nx-scopes
)@commitlint/config-nx-scopes
)
I have the same issue, I tried different node version - no success. |
The same issue after upgrading to v17.2.3. |
There is a workaround for this: const {
utils: { getProjects },
} = require('@commitlint/config-nx-scopes');
const {
createProjectGraphAsync,
} = require('nx/src/project-graph/project-graph');
module.exports = {
rules: {
'scope-enum': async (ctx) => [
2,
'always',
[...(await getProjectsWrapper(ctx)), 'deps'],
],
},
};
/**
* This is a workaround for https://github.com/conventional-changelog/commitlint/issues/3820
* remove this after it is fixed.
*/
async function getProjectsWrapper(ctx) {
await createProjectGraphAsync();
return getProjects(ctx, ({ name, projectType }) => {
return projectType === 'application' || projectType === 'library';
});
} |
Looks like the above is problematic. |
This is a fixed workaround: const {
utils: { getProjects },
} = require('@commitlint/config-nx-scopes');
const {
createProjectGraphAsync,
} = require('nx/src/project-graph/project-graph');
process.env.NX_DAEMON = 'false';
module.exports = {
rules: {
'scope-enum': async (ctx) => [
2,
'always',
[...(await getProjectsWrapper(ctx)), 'deps'],
],
},
};
async function getProjectsWrapper(ctx) {
await createProjectGraphAsync();
return await getProjects(ctx, ({ name, projectType }) => {
return projectType === 'application' || projectType === 'library';
});
} |
@artursudnik Thanks for your fix, it worked, but our "version" command dropped all versions to 0.1.0, I'm not sure if it is connected somehow 😬 |
@morozovamv I am not sure what "version" you mean... |
@artursudnik I created a discussion jscutlery/semver#759 UPD: @escapedcat sorry, clicked wrong suggestion when replied |
Expected Behavior
When using the
@commitlint/config-nx-scopes
with a typical configuration and executing commitlint on a clean local copy (empty nx cache), I would expectgetProjects
function to be executed without errors.Current Behavior
I am getting the following error:
Affected packages
Possible Solution
No response
Steps to Reproduce
npx nx reset
echo 'feat(backend): adding a feature' | npx commitlint -g commitlint.config.js
The text was updated successfully, but these errors were encountered: