I found this very strange and unfortunate behavior in Dart. When I import 'dart:html' in my main file, my Isolate stops working.
With my file "isolate.dart" :
main(){
print('BAM');
}
This prints "BAM":
import 'dart:core';
import 'dart:isolate';
void main() {
Isolate.spawnUri(Uri.parse('isolate.dart'), [], null);
}
but this prints nothing :
import 'dart:core';
import 'dart:isolate';
import 'dart:html';
void main() {
Isolate.spawnUri(Uri.parse('isolate.dart'), [], null);
}
How can I get Isolate to work while using the html import?
UPDATE : I've found this code https://github.com/TomCaserta/ExampleIsolate and tried to work it to find the problem. It seems like the print() call from the Isolate is causing problems.