ngx-deploy-npm: ngx-deploy-npm:deploy fails with nx 15.4.4

It might fail in other 15.4.x versions as well.

I notice the plugin depends on a specific version of nx. If I remove ngx-deploy-npm/node-modules so that require("@nrwl/devkit") pulls the 15.4.4 version instead of the 15.2.3 version, the deploy target succeeds.

Here is the error I get (had to retype by hand, hopefully no typos):

TypeError: Cannot read properties of undefined (reading 'nodes')
  at splitTarget (/Users/.../node_modules/nx/src/utils/split-target.js:7:51)
  at parseTargetString (/Users/.../node_modules/ngx-deploy-npm/node_modules/@nrwl/devkit/src/executors/parse-target-string.js:17:77)
  at /Users/.../node_modules/ngx-deploy-npm/src/executors/deploy/actions.js:10:66
  at Generator.next (<anonymous>)
  at /Users/.../node_modules/tslib/tslib.js:118:75
  at new Promise (<anonymous>)
  at Object.__awaiter (/Users/.../node_modules/tslib/tslib.js:114:16)
  at deploy (/Users/.../node_modules/ngx-deploy-npm/src/executors/deploy/actions.js:8:20)
  at /Users/.../node_modules/ngx-deploy-npm/src/executors/deploy/executor.js:14:14
  at Generator.next (<anonymous>)
Error when trying to publish the library

It looks like your “local” (15.2.3) version of nx is getting the “global” (15.4.4) version of nx when parseTargetString is run, causing the error since they are different versions.

I notice you have a PR ready to update this repo to 15.4.4. Could you merge and rebuild to clear this up?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 19 (10 by maintainers)

Most upvoted comments

As a work around you can use

  "resolutions": {
    "@nrwl/devkit": "^15.4.5"
  }

Hello everyone.

Updating to V15.4.X is on the roadmap. Currently, there are two problems with it.

Plugin not working for Angular Workspaces

https://github.com/bikecoders/ngx-deploy-npm/actions/runs/3859037630/jobs/6578212774

We offer support for Angular workspaces, and with that version, our tests indicate that our Angular users would remain without support if we update to that version. The problem seems to be on the Nx side.

Integration tests failing for React and React Native

https://github.com/bikecoders/ngx-deploy-npm/actions/runs/3859037630/jobs/6578189754

The fix looks easy. It takes less time to solve.


For now, judging by the comment’s reactions, it seems @jbadeau 's workaround is working

We’re going to think about other solutions to this problem. In the past, we have faced these kinds of situations, and potential solutions risen

We will never again have these kinds of problems with ngx-deploy-npm@5.0.0.

Thank you, @samuelfernandez for the work done on #473

thanks @dianjuar !

Since the fix isn’t on the horizon and the wider affected users by this are the ones using Nx, I will make the necessary modifications to the CI pipeline to make the Angular Test optional and land the solution for Nx,

The Angular users don’t need to update. Only installing a previous version should be enough to dodge the problem. On the Nx’s, the problem is a lot more complicated.

On v15.5.1, all the problems seem to be fixed https://github.com/bikecoders/ngx-deploy-npm/pull/448

In the next few hours, we’ll publish it.

Thanx too

Thanks so much @dianjuar

Hello folks. On ngx-deploy-npm V4.3.11, you will get the fix for this issue. Thank you so much for your patience on this. Please let me know if everything is working as expected.

@samuelfernandez RIght now, it’s not. We would need to modify the Release CI process to skip angular tests. Right now, they are required