Closed enyo closed 8 years ago
For google_maps
source_gen
is only used to generate source files. If you only use google_maps
you can ignore the source_gen
dependency by using :
dependency_overrides:
source_gen: 0.5
Let me know if it works or not.
Great, thanks!
If it's only used to build the library, shouldn't they go to dev_dependencies
?
Oh... unfortunately it only worked in dartium, and not Chrome.
Actually, there's a generator that does use source_gen
to generate files. Thegenerated files depend on lib/js_wrapping.dart but don't need source_gen
to work.
google_maps
has been generated with source_gen
but the package can be used without this source_gen
dependency.
I just tried https://github.com/a14n/dart-google-maps/tree/master/example/01-basics/map-simple and removing the packages/source_gen
directory. It works with Dart 1.15.0 in Dartium and dart2js.
When I try to compile to js
I get
[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/map/map.dart:19:3:
External method without an implementation.
external factory _GMap(Node mapDiv, [MapOptions opts]);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/map/map_options.dart:19:3:
External method without an implementation.
external factory _MapOptions();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/controls/map_type_control_options.dart:19:3:
External method without an implementation.
external factory _MapTypeControlOptions();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What Dart version are you using ?
Actually, there's a generator that does use source_gen to generate files. Thegenerated files depend on lib/js_wrapping.dart but don't need source_gen to work. google_maps has been generated with source_gen but the package can be used without this source_gen dependency.
So the correct way would be to add js_wrapping
as a dependency, and source_gen
as a dev_dependency
?
I'm using dart 1.15.
EDIT:
source_gen 0.4.8
js_wrapping 0.2.0+1
google_maps 3.1.0
Not really because the generator (used in google_maps) need this transitionnal dependency. dev_dependency
would make the generator only usable inside js_wrapping
which is not what is needed.
Do you have any idea why it wouldn't work or what I could try?
Is your project public ? Do you have a URL ?
No unfortunately not.
So, the problem was that we imported a server package in the client. :-/
This would be great since we aren't able to use
google_maps
otherwise