0
votes

I am trying to use deferred libraries and the new async style, but it does not seem to work:

import 'dart:async';

import 'package:defer/library1.dart' deferred as lib1;

void main() async {
  var b = await lib1.loadLibrary();
  var a = new lib1.MyClass('Peter');
  print(a.name);
}

The deferred library is never loaded and Dartium loading indication always stays on.

Am I doing something wrong?

1
Don't you get an error when you run the code like type '_Future' is not a subtype of type 'void' of 'function result'. for the void before main()...?Günter Zöchbauer
No, I found what was wrong, but I don;t know why its wrong: removing the async_await transformed from the config resolved the issue. Later on I tried adding it last (after the other transformers) and it also worked, only broke it when added as first transformer. Submitted bug, Seth Ladd advised against the usage of this transformer so I will not make further attempts to make it work.Peter StJ

1 Answers

1
votes

For some reason using the async_await transformer was the issue. See https://github.com/dart-lang/async_await/issues/81