projectstorm / react-diagrams

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

Trying to create a custom element but get : Module parse failed: Unexpected token You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. #889

Open rzfzr opened 2 years ago

rzfzr commented 2 years ago

I'm using the DefaultNodeModel as a model

./node_modules/@projectstorm/react-diagrams-defaults/src/port/DefaultPortModel.ts 11:7
Module parse failed: Unexpected token (11:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { AbstractModelFactory, DeserializeEvent } from '@projectstorm/react-canvas-core';
| 
> export interface DefaultPortModelOptions extends PortModelOptions {
|   label?: string;
|   in?: boolean;
aaron-michaux commented 2 years ago

Did you register the node factory with your engine?

  engine.getNodeFactories().registerFactory(new MyNodeFactory())