Unable to get sample code to work.
See original GitHub issueI’m following examples on: https://projectstorm.gitbook.io/react-diagrams/getting-started/using-the-library
First issue was installing @projectstorm/react-diagrams
. I could not get any examples to run without npm install --save
the following:
@emotion/core
@emotion/styled
@projectstorm/react-canvas-core
closest
mathjs
pathfinding
After installing those, I was able to start my react-app. Adding the following triggers an error:
const engine = createEngine();
Error being:
TypeError: class constructors must be invoked with 'new'
It’s expecting new createEngine();
but all example code and docs don’t show use of new
.
I’m curious if anyone else is experiencing this or if I perhaps installed this incorrectly or using this incorrectly?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
What to do if the code doesn't work? - GeeksforGeeks
This article will discuss the different routes one could take if their code fails to work in various scenarios.
Read more >Coding problems? Learn what to do when you're stuck
Even the best programmers get stuck sometimes. Here are some tips to help you get unstuck and learn from your mistakes.
Read more >Troubleshooting the CodeQL workflow - GitHub Docs
Creating CodeQL debugging artifacts by re-running jobs with debug logging ... If your workflow fails with an error No source code was seen...
Read more >Unable to run Java code with Intellij IDEA - Stack Overflow
Go to "Run" menu and "Edit configuration" · Click on add(+) icon and select Application from the list. · In configuration name your...
Read more >Can't execute code in break mode - Microsoft Learn
You tried to run code from the Macro dialog box. However, Visual Basic was already running code, although the code was suspended in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could we have those deps installed as peer dependencies of maybe projectstorm/react-canvas-core? Or the other packages that will use them?
I think this library is really great and it would be cool to have the out of the box experience after adding the main package.
For anyone stuck at this stage where you need to install multiple additional dependencies, just use this command, and add CSS for the
CanvasWidget
element: