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
TypeError: Cannot read properties of undefined (reading 'projects')
at normalizeDependencyConfigProjects (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/utils.js:31:24)
at normalizeDependencyConfigDefinition (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/utils.js:24:46)
at /node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/utils.js:19:33
at Array.flatMap (<anonymous>)
at getDependencyConfigs (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/utils.js:19:13)
at ProcessTasks.processTask (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/create-task-graph.js:68:68)
at ProcessTasks.processTasks (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/create-task-graph.js:40:18)
at createTaskGraph (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/create-task-graph.js:177:21)
at createTaskGraphAndValidateCycles (/node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/run-command.js:65:63)
at /node_modules/.pnpm/[email protected]/node_modules/nx/src/tasks-runner/run-command.js:88:27
export function normalizeTargetDependencyWithStringProjects(
dependencyConfig: TargetDependencyConfig
): Omit<TargetDependencyConfig, 'projects'> & { projects: string[] } {
if (typeof dependencyConfig.projects === 'string') {
/** LERNA SUPPORT START - Remove in v20 */
// Lerna uses `dependencies` in `prepNxOptions`, so we need to maintain
// support for it until lerna can be updated to use the syntax.
//
// This should have been removed in v17, but the updates to lerna had not
// been made yet.
//
// TODO(@agentender): Remove this part in v20
if (dependencyConfig.projects === 'self') {
delete dependencyConfig.projects;
} else if (dependencyConfig.projects === 'dependencies') {
dependencyConfig.dependencies = true;
delete dependencyConfig.projects;
return;
/** LERNA SUPPORT END - Remove in v20 */
} else {
dependencyConfig.projects = [dependencyConfig.projects];
}
}
return dependencyConfig as Omit<TargetDependencyConfig, 'projects'> & {
projects: string[];
};
}
…urn undefined (#26994)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#26975
(cherry picked from commit 188f0d8)
Current Behavior
I use [email protected] [email protected].
I noticed that in the normalizeTargetDependencyWithStringProjects function, if projects='dependencies', it will directly return.
https://github.com/nrwl/nx/blob/master/packages/nx/src/tasks-runner/utils.ts#L198
This leads to a TypeError: Cannot read properties of undefined (reading 'projects') being thrown at the call site.
https://github.com/nrwl/nx/blob/master/packages/nx/src/tasks-runner/utils.ts#L72
Expected Behavior
Don't throw type error.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: