I'm trying to initialize Cytoscape.js for an obsidian plugin. I've imported Cytoscape as follows: import cytoscape from 'cytoscape';, and I'm calling it a bit later using const viz = cytoscape();.
I'm also using Rollup and Typescript.
The resulting main.js I'm using crashes with
app.js:1 Plugin failure: neo4j-graph-view TypeError: Cannot assign to read only property 'remove' of object '[object Object]'
at eval (eval at <anonymous> (app.js:1), <anonymous>:52657:17)
at e.<anonymous> (app.js:1)
at app.js:1
at Object.next (app.js:1)
at a (app.js:1)
This error can be resolved by commenting out elesfn$u.remove in the resulting main.js. I think this is this line. Is this a bug/incompatibility?
The same crash happens when I just run in the codebase
I've been in contact with the developers of Obsidian. They've been manipulating Array.prototype as well, but in such a way that it becomes readonly. They'll fix this in their next release.
Environment info
Current (buggy) behaviour
I'm trying to initialize Cytoscape.js for an obsidian plugin. I've imported Cytoscape as follows:
import cytoscape from 'cytoscape';
, and I'm calling it a bit later usingconst viz = cytoscape();
.I'm also using Rollup and Typescript.
The resulting
main.js
I'm using crashes withThis error can be resolved by commenting out
elesfn$u.remove
in the resulting main.js. I think this is this line. Is this a bug/incompatibility?The same crash happens when I just run in the codebase
My tsconfig.json:
The rollup.config.js: