Nx migrate does not work with Angular Material/CDK
See original GitHub issueCurrent Behavior
Running nx migrate @angular/material
or nx migrate @angular/cdk
in the nx workspace fails with Cannot read property 'split' of undefined
error.
Expected Behavior
I expect that to work especially if nx at the same time completely blocking my ability to use ng update
.
Steps to Reproduce
Run nx migrate @angular/material
in the project.
Failure Logs
nx migrate @angular/material
yarn run v1.22.4
$ /Users/<...>/angular-monorepo/node_modules/.bin/tao migrate @angular/material
Fetching meta data about packages.
It may take a few minutes.
Fetching @angular/material@latest
Fetching @angular/material@11.0.2
ERROR The migrate command failed. Try the following to migrate your workspace:
> npx @nrwl/tao@latest migrate @angular/material@latest
This will use the newest version of the migrate functionality, which might have your issue resolved.
----------------------------------------------------------------------------------------------------
Cannot read property 'split' of undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/Users/<...>/angular-monorepo/node_modules/yargs/build/lib/yargs.js:1132
throw err;
^
Error: Command failed: yarn tao migrate @angular/material
at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Object.handler (/Users/<...>/angular-monorepo/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:74:21)
at Object.runCommand (/Users/<...>/angular-monorepo/node_modules/yargs/build/lib/command.js:196:48)
at Object.parseArgs [as _parseArgs] (/Users/<...>/angular-monorepo/node_modules/yargs/build/lib/yargs.js:1043:55)
at Object.get [as argv] (/Users/<...>/angular-monorepo/node_modules/yargs/build/lib/yargs.js:986:25)
at Object.initLocal (/Users/<...>/angular-monorepo/node_modules/@nrwl/cli/lib/init-local.js:23:13)
at Object.<anonymous> (/Users/<...>/angular-monorepo/node_modules/@nrwl/cli/bin/nx.js:41:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 48247,
stdout: null,
stderr: null
}
Environment
Node : 12.16.1 OS : darwin x64 yarn : 1.22.4
nx : Not Found @nrwl/angular : 11.0.0 @nrwl/cli : 11.0.0 @nrwl/cypress : 11.0.0 @nrwl/devkit : 11.0.0 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : 11.0.0 @nrwl/linter : 11.0.0 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 11.0.0 @nrwl/web : Not Found @nrwl/workspace : 11.0.0 typescript : 4.0.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
It looks like the fix for this issue fixed it by not trying to execute migrations that would fail in this way.
I’m skeptical whether this really fixes things though; presumably these (in this example) CDK migrations exist for a reason, and should be executed to update application code in their intended way, not skipped?
Just an FYI @FrozenPandaz, for when I run the migration on the latest change I get the following for every single library:
I don’t know if thats expected?