projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.69k stars 1.17k forks source link

Failed to compile - Module not found #765

Closed ghost closed 3 years ago

ghost commented 3 years ago

After installation as described in the documentation I got the following errors.

Module not found: Can't resolve 'ml-matrix' I think this package should not be a dependency anymore but Point.js still requires it (../node_modules/@projectstorm/geometry/dist/es/Point.js). See also #763

Module not found: Can't resolve '@emotion/react' It seems that @emotion/core has been renamed to @emotion/react.

How do I get this fixed? Thanks for the help!

renato-bohler commented 3 years ago

You probably will have to add those two dependencies: ml-matrix and @emotion/react (or @emotion/core? Not sure =p).

ml-matrix has been removed, but no version has been released ever since. That's why you still need it.

ghost commented 3 years ago

I was able to fix it. There were further bugs to fix afterwards. I would like to note that it can only be a temporary solution. This package should be updated as well. Now here the steps.

Get the package

npm install @projectstorm/react-diagrams@next

Install the peer dependencies

Make sure to add ml-matrix because it is needed in the current build. Also include @emotion in version 10 because they renamed @emotion/core to @emotion/react in the latest verison 11.

npm install closest lodash react dagre pathfinding paths-js resize-observer-polyfill ml-matrix @emotion/core@10.1.1 @emotion/styled@10.0.3

Fix next errors

As mentioned in #598 you have to do the following.

mikkelking commented 3 years ago

I hit the same problem. The workaround solves the problem for now

dylanvorster commented 3 years ago

releasing a new version of the lib now that matches the docs