0

Dart 2.7 build_runner: 1.7.3 build_web_compilers: 2.9.0

I've created an interface for GoJS using the package js: https://github.com/jodinathan/gojs_dart/ The problem is that it works flawlessly in DDC but throws an exception when using with Dart2JS.

Here is a small repro you can check: https://github.com/jodinathan/gojs_dart/tree/master/example/flowchart

The error seems to be in the line ..bind(GoJSBinding('text').makeTwoWay()) I think it can't find the bind() function, however, it can when in DDC.

Any ideas on how I could solve this?

The issue is in the dart-sdk: https://github.com/dart-lang/sdk/issues/40434

Jonathan
  • 4,724
  • 7
  • 45
  • 65

1 Answers1

0

It looks like dart2js requires an external factory constructor on all classes while dartdevc does not. So for instance for the first error it hits today you have a class like this:

@JS('Node')
class GoJSNode extends GoJSPart {}

And it should look like this:

@JS('Node')
class GoJSNode extends GoJSPart {
  external factory GoJSNode();
}
Jake MacDonald
  • 1,348
  • 6
  • 7