Closed xhluca closed 6 years ago
Here are the steps to reproduce it:
dash-cytoscape
directorydash-component-boilerplate
inside the directoryyarn add react-cytoscapejs
npm install
npm run start
Alternative, take a look at https://github.com/plotly/dash-cytoscape/tree/4256895be22e2adfc412fb450d4bd0bd2101e9ce
@xhlulu - Let's discuss in https://github.com/plotly/dash-cytoscape/ as this isn't an issue with react-cytoscapejs
.
Module not found: Error: Can't resolve 'react-cytoscapejs' in 'C:\Users\xingh\git\dash-cytoscape\src\demo'
This error message is trying to tell you the error. In JS (es6), there are relative imports just like in Python. When you do import CytoscapeComponent from 'react-cytoscapejs';
it's trying to import a file named react-cytoscape
from the current directory of the file. But, the file is in some demo
folder so it can't import it. So, you'll need to do a relative import, something like import CytoscapeComponent from '../../src/react-cytoscapejs'
. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import for more details
When I try to run the example given in readme, the following is returned:
The following code is written in App.js:
and ran in index.js (by calling NPM run start):
@chriddyp