question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get sample code to work.

See original GitHub issue

I’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:open
  • Created 4 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

8reactions
alexandrudanpopcommented, Nov 4, 2019

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.

1reaction
sibeshkarcommented, Nov 1, 2019

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:

npm install --save @emotion/core @emotion/styled @projectstorm/react-canvas-core closest mathjs pathfinding dagre paths-js resize-observer-polyfill
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found