Skip to content

Cytoscape upgrade from 3.28.1 to 3.29.0 or higher does not recognize external dependencies such as fcose #3377

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

Open
6 tasks
IOkal opened this issue May 17, 2025 · 0 comments
Labels
bug A bug in the code of Cytoscape.js

Comments

@IOkal
Copy link

IOkal commented May 17, 2025

Environment info

  • Cytoscape.js version: 3.32.0 (regression appears starting in 3.29.0)
  • Browser / Node.js & versions:
    • Chrome 136.0.7103.93
    • Firefox 137.0.2
    • Node.js v20.12.2
  • Bundler: Vite v4.x
  • Framework: React 18.x

Current (buggy) behaviour

After upgrading Cytoscape from v3.28.1 to any v3.29.0+ (up through v3.32.0), all third-party and custom extensions fail to register:

  1. Plugin imports are undefined at runtime:

    import cytoscape from 'cytoscape';
    import fcoseImport from 'cytoscape-fcose';
  2. Calling cytoscape.use(fcoseImport) silently does nothing, so calling the layout yields:

    Uncaught Error: No such layout fcose found. Did you forget to import it and cytoscape.use() it?
    
  3. Even the built-in layouts (e.g. { name: 'grid' }) work, but any custom or third-party layout (fcose, cola, grid-guide, expand-collapse, svg plugin) is unavailable.

  4. Earlier in the upgrade process we also saw:

    Uncaught SyntaxError: The requested module '…/dist/cytoscape.cjs.js' doesn't provide an export named: 'default'
    

    reflecting the ESM/CJS entry-point changes in 3.29.0.


Desired behaviour

  • cytoscape-fcose, cytoscape-cola, cytoscape-grid-guide, cytoscape-expand-collapse and custom plugins (svg) should register and run correctly after upgrading to any 3.29.0+ release without special bundler workarounds.

  • The standard pattern…

    import cytoscape from 'cytoscape';
    import fcose from 'cytoscape-fcose';
    cytoscape.use(fcose);

    …should “just work” as it did in v3.28.1.

  • The default ES module entrypoint (cytoscape/dist/cytoscape.esm.mjs) should export a true default and allow extensions to attach via cytoscape.use(...).


Minimum steps to reproduce
(You will need to go through the setup of Workload Discovery on AWS to reproduce).

  1. git clone https://github.com/aws-solutions/workload-discovery-on-aws.git
    cd workload-discovery-on-aws/source/frontend
  2. In package.json, set

    "dependencies": {
      "cytoscape": "^3.29.0",   // or higher up to 3.32.0
      "cytoscape-fcose": "^2.1.0",
      "cytoscape-cola": "^3.3.0",
      // …
    }
  3. npm install
    npm run start
  4. Open http://localhost:5173, navigate to Diagrams → Draw, and watch the browser console:

    • You’ll see fcoseImport: undefined
    • Then Uncaught Error: No such layout fcose found…

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

  • Ensure that the reporter has included a reproducible demo. They can easily fork this JSBin demo: http://jsbin.com/fiqugiq
  • The issue has been associated with a corresponding milestone.
  • The commits have been incorporated into the corresponding branches. Bug-fix patches go on
    • master and
    • unstable.
  • The issue has been labelled as a bug, if necessary.
@IOkal IOkal added the bug A bug in the code of Cytoscape.js label May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the code of Cytoscape.js
Projects
None yet
Development

No branches or pull requests

1 participant