iVis-at-Bilkent / cytoscape.js-fcose

fCoSE: a fast Compound Spring Embedder
MIT License
134 stars 25 forks source link

Could not find a declaration file for module 'cytoscape-fcose' #51

Closed jonng1000 closed 2 years ago

jonng1000 commented 2 years ago

Hi, I am using react-cytoscapejs in my code, and when I import fcose as per the instructions here: import Cytoscape from 'cytoscape'; import fcose from 'cytoscape-fcose';

I get this error: module "C:/Users/weixiong001/Documents/golabel/node_modules/cytoscape-fcose/cytoscape-fcose" Could not find a declaration file for module 'cytoscape-fcose'. 'C:/Users/weixiong001/Documents/golabel/node_modules/cytoscape-fcose/cytoscape-fcose.js' implicitly has an 'any' type. Trynpm i --save-dev @types/cytoscape-fcoseif it exists or add a new declaration (.d.ts) file containingdeclare module 'cytoscape-fcose';ts(7016)

May I know how do I fix this issue please? Or can I safely ignore it?

Thank you Jonathan

hasanbalci commented 2 years ago

I suppose it's related with your TypeScript settings. You can check this and this pages in stackoverflow for possible solutions.

jonng1000 commented 2 years ago

Dear Hasan,

Thanks for your quick reply. I've read those pages but am still lost. Do you if its possible for me to get step by step instructions to set the types correctly? I understand I have to do that but am not sure how. Very sorry for the trouble. I am new to javascript and come from a python background. Would uninstalling and reinstalling this module help?

Many thanks Jonathan

hasanbalci commented 2 years ago

Unfortunately, I'm not very experienced with TypeScript either. Maybe, you can also use stackoverflow for a detailed answer.