cytoscape / cytoscape.js-dagre

The Dagre layout for DAGs and trees for Cytoscape.js
MIT License
245 stars 82 forks source link

not captable with vite in esModule system #110

Closed cdll closed 1 year ago

cdll commented 1 year ago

as I tried

import cytoscape from 'cytoscape';
import dagre from 'cytoscape-dagre';

cytoscape.use( dagre );

I got this Error in browser:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Graph')
    at ../../node_modules/.pnpm/cytoscape-dagre@2.3.2_cytoscape@3.18.3/node_modules/cytoscape-dagre/node_modules/dagre/lib/greedy-fas.js (greedy-fas.js:2:13)
    at __require2 (chunk-S5KM4IGW.js?v=03374713:18:50)
    at ../../node_modules/.pnpm/cytoscape-dagre@2.3.2_cytoscape@3.18.3/node_modules/cytoscape-dagre/node_modules/dagre/lib/acyclic.js (acyclic.js:4:17)
    at __require2 (chunk-S5KM4IGW.js?v=03374713:18:50)
    at ../../node_modules/.pnpm/cytoscape-dagre@2.3.2_cytoscape@3.18.3/node_modules/cytoscape-dagre/node_modules/dagre/lib/layout.js (layout.js:4:15)
    at __require2 (chunk-S5KM4IGW.js?v=03374713:18:50)
    at ../../node_modules/.pnpm/cytoscape-dagre@2.3.2_cytoscape@3.18.3/node_modules/cytoscape-dagre/node_modules/dagre/index.js (index.js:26:11)
    at __require2 (chunk-S5KM4IGW.js?v=03374713:18:50)
    at webpackUniversalModuleDefinition (cytoscape-dagre.js:3:28)
    at ../../node_modules/.pnpm/cytoscape-dagre@2.3.2_cytoscape@3.18.3/node_modules/cytoscape-dagre/cytoscape-dagre.js (cytoscape-dagre.js:10:1)
cdll commented 1 year ago

(the Error is shown in a Promise because I ran into the error at first, so I tried to load the module async with import() so that my page could show up anyway)

Is there a minified version that I could use?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.