react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

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

Open phakhee opened this issue 4 years ago • 5 comments

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?

phakhee avatar Jan 29 '21 11:01 phakhee

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

renato-bohler avatar Feb 01 '21 11:02 renato-bohler

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 :/

phakhee avatar Feb 02 '21 13:02 phakhee

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

MNewbigging avatar Oct 20 '21 20:10 MNewbigging

Any solution to this bug? Any workaround?

MatteoGioioso avatar Mar 03 '23 16:03 MatteoGioioso

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: @.***>

phakhee avatar Mar 04 '23 03:03 phakhee