Skip to content
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

dep graph not generated due to errors #1551

Closed
cladera opened this issue Jul 4, 2019 · 16 comments
Closed

dep graph not generated due to errors #1551

cladera opened this issue Jul 4, 2019 · 16 comments
Assignees
Labels
community This is a good first issue for contributing outdated scope: core core nx functionality type: bug

Comments

@cladera
Copy link

cladera commented Jul 4, 2019

Expected Behavior

It should generate the dependencies graph of my project.

Current Behavior

When I run npm run dep-graph It generates an image with all my libs and apps in a row with no connections between them.

Failure Information (for bugs)

[project root]node_modules/viz.js/viz.js:33 Invalid asm.js: Function definition doesn't match use

Steps to Reproduce

  1. npm run dep-graph

Context

Angular CLI version output

Angular CLI: 8.0.3
Node: 12.3.1
OS: darwin x64
Angular: 8.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.1
@angular-devkit/build-angular      0.800.6
@angular-devkit/build-ng-packagr   0.800.6
@angular-devkit/build-optimizer    0.800.6
@angular-devkit/build-webpack      0.800.6
@angular-devkit/core               8.0.1
@angular-devkit/schematics         8.0.1
@angular/cdk                       8.0.1
@angular/flex-layout               8.0.0-beta.26
@angular/material                  8.0.1
@angular/material-moment-adapter   8.0.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.6
@schematics/angular                8.0.1
@schematics/update                 0.800.3
ng-packagr                         5.3.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Nx version

8.1.2

Other

I began to notice this error after importing an existing project to our monorepo. After the import several libraries and apps where created although it did not require adding any extra dependency, they were libs and apps pretty similar to the ones that were already in the monorepo.

@vsavkin
Copy link
Member

vsavkin commented Jul 9, 2019

@cladera could you provide a repro?

@cladera
Copy link
Author

cladera commented Jul 9, 2019

I tried (https://github.com/cladera/nx-dep-graph-issue) but I couldn't reproduce the error. I guess there is something wrong specific to my libraries and apps or with my vendor dependencies.

But I do see though is the same error message in the log:

> dep-graph-issue@0.0.0 dep-graph /Users/cgcladera/Desktop/dep-graph-issue
> nx dep-graph

(node:10016) V8: /Users/cgcladera/Desktop/dep-graph-issue/node_modules/viz.js/viz.js:33 Invalid asm.js: Function definition doesn't match use

@vsavkin
Copy link
Member

vsavkin commented Jul 12, 2019

@cladera we are using graphviz to generate the graph.

I might be related to mdaines/viz-js#96.

I'm really sorry but it's hard for us to investigate without having a repro. So if you cannot create a repro, I'll have to close the issue.

@cladera
Copy link
Author

cladera commented Jul 12, 2019

@vsavkin Don't worry, I totally understand. I'll try to debug my self in our project and get back to this issue if I learn something new.

@ynoval
Copy link

ynoval commented Jul 22, 2019

https://github.com/ynoval/mssone.git is a repo with he same error:
$ npm run dep-graph
..

nx dep-graph

(node:31475) V8: /home/yoel/MSS-ONE/borrar/mssone/node_modules/viz.js/viz.js:33 Invalid asm.js: Function definition doesn't match use

Angular CLI: 8.0.0
Node: 12.6.0
OS: linux x64
Angular: 8.1.2

Thanks!! Nx is a great tool

@haskelcurry
Copy link

haskelcurry commented Aug 14, 2019

Same problem, @cladera @ynoval did you guys found any workaround or cause of this? Thanks!

@CRACKISH
Copy link

Same problem here ((((

C:\Projects\Angular\work>nx dep-graph --verbose
(node:1232) V8: C:\Projects\Angular\work\node_modules\viz.js\viz.js:33 Invalid asm.js: Function definition doesn't match use

@cladera
Copy link
Author

cladera commented Sep 20, 2019

@mtuzinskiy No, I didn't. Actually it became a real pain. Now I don't know if the problem is with the graph generation or nx is not actually able to map my dependencies.

I ran into serious problems lately because of this problem...

@haskelcurry
Copy link

haskelcurry commented Sep 21, 2019

@cladera Well, I have tried it out with freshly created Nx project, and it's the same. So it's NOT related to your dependencies. Could you please try it with the fresh one too, to verify? Shouldn't take much of your time :)

@cladera
Copy link
Author

cladera commented Sep 23, 2019

@mtuzinskiy I did what you suggested. I created a brand new project with one angular app and one angular library. When I run npm run dep-graph I got the mentioned error but the graph tree is rendered whereas in my project it will never render.

(node:1729) V8: /Users/cgcladera/Desktop/dep-graph/node_modules/viz.js/viz.js:33 Invalid asm.js: Function definition doesn't match use

Screen Shot 2019-09-23 at 09 11 52

@haskelcurry
Copy link

@cladera Could you please re-check if you have the same version of Nx in your new and old project?

@vsavkin
Copy link
Member

vsavkin commented Sep 27, 2019

I did more digging. It looks like the issue occurs only on Node 12.

It looks like the following libraries are deprecated:

"graphviz": "^0.0.9",
"viz.js": "^1.8.1",

I think we should replace it with:
https://github.com/dagrejs/dagre/wiki

Would you like to do it folks? It's just one file in the nx repo that has to be updated. I can help you out.

@vsavkin vsavkin self-assigned this Sep 27, 2019
@vsavkin vsavkin added community This is a good first issue for contributing and removed blocked: repro needed labels Sep 27, 2019
@cladera
Copy link
Author

cladera commented Sep 28, 2019

@mtuzinskiy yes, I had the same version in my project and in the brand new project.

@cladera
Copy link
Author

cladera commented Oct 3, 2019

I figure out what was going on with my project and I think it is solved now.

There were two things I configured wrong:

  1. At some point we changed the npmScope property in the nx.json file. After some time debugging I realized this value is passed to the dependencies calculator so I figured it had to do with how nx creates the dep tree. When I changed the npmScope to its original value, all the projects with that scope in the tsconfig.json's paths appeared connected in the dep graph.

  2. We had libraries with different npm scopes (changed manually in tsconfig.json file). We needed to do so for libraries that we wanted to publish to npm and not all of them were under the same npm scope.
    If I use the same scope for all my libraries and apps the dep graph is generated right. In our case it's alright because the libraries we were publishing to npm were private and actually all its dependant are now part of the monorepo so we no longer need to publish them. But still it is kind of a limitation, isn't it?

@vsavkin vsavkin added the scope: core core nx functionality label Dec 5, 2019
@FrozenPandaz
Copy link
Collaborator

We no longer use graphviz for our dep-graph so this issue should not occur as of 8.6.0.

Please file a new issue if you have issues with the new implementation for dep-graph.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

7 participants