projectstorm / react-diagrams

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

TypeError: Class constructor AbstractReactFactory cannot be invoked without 'new' #801

Open phakhee opened 3 years ago

phakhee commented 3 years ago

I was trying to implement a custom styled node, I followed the example exactly but I'm getting this error: TypeError: Class constructor AbstractReactFactory cannot be invoked without 'new'

This is the code I'm trying to run: image image

I've already looked around the issues around here related with babel and webpack, this is a feature I'm adding to an existing project and I don't think it uses webpack and I don't see a babel config file either. I can't really just add new stuff to the project either.

The only files I see that are config related are:

.eslintrc image

.stylelintrc image

jsconfig.json image

I have tried adding "babel": { "presets": [ [ "@babel/preset-env", { "targets": { "esmodules": true } } ], "@babel/preset-react", "@babel/preset-flow" ] }, to my package.json, but it doesn't work for me.

We use mobx in this project too, which uses classes extending, but not extending from node module classes. I also took a look in the yarn.lock file and see that we have babel-plugin-transform-es2015-classes@^6.23.0: installed, maybe that can be causing problems?

Is there anything I can do with these files or what should fix it?

renato-bohler commented 3 years ago

Hey! There's another issue with a possible solution to this. I don't know if you tried it: https://github.com/projectstorm/react-diagrams/issues/583#issuecomment-605758715

phakhee commented 3 years ago

Hey! There's another issue with a possible solution to this. I don't know if you tried it: #583 (comment)

I tried this already, doesn't work for me :/

MNewbigging commented 2 years ago

I've just ran into this exact issue myself - I take it you didn't find a solution @phakhee ?

MatteoGioioso commented 1 year ago

Any solution to this bug? Any workaround?

phakhee commented 1 year ago

I indeed did not find a solution

On Fri, Mar 3, 2023, 17:36 Matteo Gioioso @.***> wrote:

Any solution to this bug? Any workaround?

— Reply to this email directly, view it on GitHub https://github.com/projectstorm/react-diagrams/issues/801#issuecomment-1453793988, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALT7C25DWKJMQGHQ2A3ZRQLW2IMZXANCNFSM4WYWJPAQ . You are receiving this because you were mentioned.Message ID: @.***>