swimlane/ngx-graph

Not working with angular 13

RolfVeinoeSorensen opened this issue · 8 comments

Describe the bug
Multiple dependencies missing

To Reproduce
Steps to reproduce the behavior:

  1. npm install @swimlane/ngx-graph --save
  2. See errors

Expected behavior
Should be able to build.
dependencies in package json
"dependencies": { "@angular/animations": "~13.1.0", "@angular/common": "~13.1.0", "@angular/compiler": "~13.1.0", "@angular/core": "~13.1.0", "@angular/forms": "~13.1.0", "@angular/platform-browser": "~13.1.0", "@angular/platform-browser-dynamic": "~13.1.0", "@angular/router": "~13.1.0", "@swimlane/ngx-graph": "~8.0.0", "rxjs": "~7.4.0", "tslib": "^2.3.0", "zone.js": "~0.11.4" },

Errors
Error: Module not found: Error: Can't resolve 'd3-scale'
Error TS7016: Could not find a declaration file for module 'd3-dispatch'
Error TS7016: Could not find a declaration file for module 'd3-timer'
Error TS7016: Could not find a declaration file for module 'd3-drag

ngx-graph version
8.0.0 ^8.0.0 ~8.0.0

Installing these fixes the build problem
npm install d3-scale --save
npm i --save-dev @types/d3-dispatch
npm i --save-dev @types/d3-timer
npm i --save-dev @types/d3-drag
But introduces runtime error:
core.mjs:6461

   ERROR Error: Uncaught (in promise): TypeError: (0 , tslib__WEBPACK_IMPORTED_MODULE_22__.__decorate) is not a function

TypeError: (0 , tslib__WEBPACK_IMPORTED_MODULE_22__.__decorate) is not a function
at Module.87773 (swimlane-ngx-graph.mjs:2224:11)

Looks like it's a problem in 12 as well. However, @RolfVeinoeSorensen, I was able to run through an install of the dependencies you mention and did not hit the runtime error.

I made a clean project and was able to get ngx-graph running with angular 13.2.0 by installing the dependencies and types mentioned earlier.

Primary issue I'm having is that it only supports rxjs 6 when rsjs is on 7.x which is the preferred version for Angular 13 so I can't install with rsjs 7

same things, needs. rxjs 7

What exactly is the issue you are seeing. If I have an Angular 13 application the latest ngx-graph is working fine for me.

Working yes, but if you have rxjs 7 in your dependencies, you have npm i --force

Please, can you provide a date when a fix will be available ?
A permissive dependency like "rxjs": "^6.5.3 || ^7.4.0", would.also be good.

Most upgraded packages to Angular 13 use rxjs >= 7. Thats way I have dependency problem with this one.