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

dependencies not referenced correctly #4

Open
mmestas opened this issue Jul 15, 2021 · 3 comments
Open

dependencies not referenced correctly #4

mmestas opened this issue Jul 15, 2021 · 3 comments

Comments

@mmestas
Copy link

mmestas commented Jul 15, 2021

I'm using this in an angular 12 application and got several reference errors from this library. Eventually, I got it to work by changing the node-module directly by adding/changing the references in cytoscope-angular.js :

import { ButtonModule } from 'primeng/button'; import { DropdownModule } from 'primeng/dropdown'; import { FieldsetModule } from 'primeng/fieldset'; import { InputSwitchModule } from 'primeng/inputswitch'; import { InputTextModule } from 'primeng/inputtext'; import { OverlayPanelModule } from 'primeng/overlaypanel'; import { ProgressBarModule } from 'primeng/progressbar'; import { ProgressSpinnerModule } from 'primeng/progressspinner'; import { TooltipModule } from 'primeng/tooltip'; import { SpinnerModule } from 'primeng/spinner'; import { AutoCompleteModule } from 'primeng/autocomplete';

and

import * as cytoscape from 'cytoscape';

The errors were that cytoscape was not defined and the above primeng references had no exported module xx. It seems that each module has to be referenced individually and that cytoscape cannot be globally referenced without declaring it in an import.

@michaelbushe
Copy link
Owner

Yes the latest version should have the new package names to catch up with primeng changes.
I’m still having trouble with the CytoscapeAngularModule being recognized, I’ll see if your import helps with that.

@RobRoyce
Copy link

RobRoyce commented Apr 22, 2022

I'm getting a cityscape is not defined error and it seems to be related to the above. @mmestas would you be able to share what your imports look like in your Angular component?

I followed the example project to a T but still nothing 🤷‍♂️

Edit: specific error message is:

main.js:137353 ERROR ReferenceError: cytoscape is not defined
    at CytoscapeGraphComponent.rerender (main.js:62384)
    at main.js:62333
    at timer (polyfills.js:2933)
    at ZoneDelegate.invokeTask (polyfills.js:553)
    at Object.onInvokeTask (main.js:159381)
    at ZoneDelegate.invokeTask (polyfills.js:553)

@RobRoyce
Copy link

The odd part is I actually get a canvas with a single node (which is outlined by a "loading" animation, presumably). So cityscape is, in fact, imported into the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants