Is this possible? That is to say, I tried it and it didn't work. But in theory it should be possible shouldn't it? I'm only passing messages back and forth, isolated memory space, etc.
final sp = spawnUri('path/to/dart_html_app.dart');
IsolateSpawnException: 'Do not know how to load 'dart:html'
As someone already stated, you can't import
dart:html in the VM (at least at this point). Your solution would be to split the app into two libraries, where the one you want to spawn does not use
What are you actually trying to do? If you think you could have the browser and VM talk via isolates, that's not going to work. Isolates use a thread pool in the VM and Web Workers on the browser if they are available.
If you just want "load the code from this URI and execute it just like any code in a new isolate", then that's certainly possible -- why not? You just have to refactor your code base so that you don't import
dart:html except only when you really need it.