bwu-dart / bwu_datagrid

A data-grid Polymer element in Dart
MIT License
73 stars 26 forks source link

Unable to spawn isolate: The built-in library 'dart:html' is not available on the stand-alone VM. #127

Closed tonosama-atlacatl closed 8 years ago

tonosama-atlacatl commented 8 years ago

_Please forgive me if this is more of a "StackOverflow" type of issue. I'v been trying to get a polymer 1 project started, but so far, bringing this on my ".yaml":

bwu_datagrid: 0.1.0-dev.0
bwu_utils: '>=0.1.0 <0.2.0'
polymer: ^1.0.0-rc.5

I'm only using the sample polymer template project from intellij..., just adding the bwu_datagrid references to the .yaml, I get this pub error:

Loading source assets...
Loading polymer and reflectable transformers...
Unable to spawn isolate: The built-in library 'dart:html' is not available on the stand-alone VM.
'package:polymer/src/template/array_selector.dart': error: line 6 pos 1: library handler failed
import 'dart:html';
^
dart:isolate-patch/isolate_patch.dart      Isolate.spawnUri.<async>
dart:async-patch/async_patch.dart 34       _asyncErrorWrapperHelper.<fn>
dart:async/zone.dart 1142                  _RootZone.runBinary
dart:async/future_impl.dart 579            _Future._propagateToListeners.handleError
dart:async/future_impl.dart 641            _Future._propagateToListeners
dart:async/future_impl.dart 432            _Future._completeError
dart:async/future_impl.dart 56             _SyncCompleter._completeError
dart:async/future_impl.dart 27             _Completer.completeError
dart:isolate-patch/isolate_patch.dart 439  Isolate._spawnCommon.<fn>
dart:isolate-patch/isolate_patch.dart 148  _RawReceivePortImpl._handleMessage
Pub Serve terminated

I'm using SDK 1.15 and polymer 1.0.0-rc6

I've tried replicating all the imports similar to your examples, and so far, no luck, I get the same error. Removing the bwu_datagrid dependencies will allow me to run the dummy example.

Is there something else I'm missing on my .yaml? or something else I should do before using bwu_datagrid?

Thanks,

Alex

tonosama-atlacatl commented 8 years ago

Adding a reflectable transformer took care of the problem:

- reflectable:
    entry_points:
zoechi commented 8 years ago

Sounds like you're running the code from console application main() instead of from a browser <script type="application/dart" src="index.dart">.

tonosama-atlacatl commented 8 years ago

I just duplicated index.html into my own entry point...this file simply calls a custom component inside Lib, this component just has the bwu_datagrid import. If I don't create a - reflectable entry_point for my new html...I get this:

Uncaught Unhandled exception:
Bad state: Reflectable has not been initialized. Did you forget to add the main file to the reflectable transformer's entry_points in pubspec.yaml?

If I remove bwu_datagrid, no need for the reflectable entry_point. Is this the correct requirement? If I create a custom component that wraps bwu_datagrid, will all my entry points need to be added to the reflectable entry_points?

tonosama-atlacatl commented 8 years ago

I think this is my deal....Polymer 1 requires the reflectable duplicate entry_point....a departure from 0.16 I guess... Thank you for help!

zoechi commented 8 years ago

Glad to hear you figured it out! Thanks for the update.