kieler / elkjs

ELK's layout algorithms for JavaScript
Other
1.82k stars 97 forks source link

Can't resolve web-worker issue #142

Open themason2011 opened 3 years ago

themason2011 commented 3 years ago

Hi guys,

Thank you so much for providing this library! It seems like it has a lot of support and great features for graphing. Unfortunately, I've been having an issue with compiling a ReactJS Front-End when using elkjs in conjunction with the cytoscape-elk repo (I'm using cytoscape as the graphing library). Even when I just try to import cytoscape-elk into my App.js file, I get the following complier error: image

Interestingly, I am able to get it working properly using the klay library, which from what I understand is just the deprecated version of elk, still created by you guys. Is there something I am missing that you guys think could cause the problem? I installed the dependencies mentioned in the repo, i.e. both elkjs and cytoscape, so I don't think it's an issue there. In addition, I looked into the file mentioned in the compiler error and found that main.js tries requiring a web-worker, but I'm not sure how to get one and it looks like it should fall back to a non-web worker version if one doesn't exist. Attached is my code as well, for reference. Thank you and I look forward to hearing from you soon!

Sincerely, Mason

image image image etc.

uruuru commented 3 years ago

Maybe related to #141.

tylerlong commented 2 years ago
yarn add --dev web-worker

resolved the issue for me.