Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile - Module not found #765

Closed
ghost opened this issue Nov 17, 2020 · 4 comments
Closed

Failed to compile - Module not found #765

ghost opened this issue Nov 17, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 17, 2020

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
Copy link
Contributor

renato-bohler commented Nov 17, 2020

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
Copy link
Author

ghost commented Nov 18, 2020

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/[email protected] @emotion/[email protected]

Fix next errors

  • TypeError: Cannot read property 'getTotalLength' of null or TypeError: path is null
  • Blank screen

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

  • remove <React.StrictMode> tags from src/index.tsx
  • add custom canvas class to <CanvasWidget engine={engine} className='canvas' />
  • add styles in src/index.css
.canvas {
  height: 100vh;
}

@mikkelking
Copy link

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

@dylanvorster
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants