a14n / dart-google-maps

A library to use Google Maps JavaScript API v3 from Dart scripts.
Apache License 2.0
130 stars 66 forks source link

It does not work with DDC #46

Closed marcinsydor closed 7 years ago

marcinsydor commented 7 years ago

There is an error when I try to use the package with DDC. Works fine in Dartium.

  req.load  
  load  
  load  
  fetch 
  check 
  enable    
  enable    
  (anonymous function)  
  (anonymous function)  
  each  
  enable    
  init  
  callGetModule 
  completeLoad  
  onScriptLoad  
Uncaught Error: Script error for "packages/google_maps/lib__google_maps", needed by: packages/avstudios_website/lib__website__components__templates__blocks_template_component
  makeError 
  onScriptError 
Error compiling dartdevc module:google_maps|lib/lib__google_maps.js

[error] The return type 'TypedJsArray' isn't a 'List<FusionTablesStyle>', as defined by the method 'styles'. (package:google_maps/src/generated/core/layers/fusion_tables_layer_options.dart, line 32, col 41)
[error] The return type 'TypedJsArray' isn't a 'List<MapTypeStyle>', as defined by the method 'styles'. (package:google_maps/src/generated/core/map/map_options.dart, line 80, col 36)
[error] Invalid override. The type of 'MapTypeRegistry.set' ('(String, MapType) → void') isn't a subtype of 'MVCObject.set' ('(String, dynamic) → void'). (package:google_maps/src/generated/core/map_types/map_type_registry.dart, line 24, col 3)
[error] The return type 'TypedJsArray' isn't a 'List<MapTypeStyler>', as defined by the method 'stylers'. (package:google_maps/src/generated/core/map_types/map_type_style.dart, line 28, col 38)
[error] The return type 'TypedJsArray' isn't a 'List<E>', as defined by the method 'getArray'. (package:google_maps/src/generated/core/mvc/mvc_array.dart, line 56, col 25)
[error] Invalid override. The type of 'MVCArray.values=' ('(Map<String, Object>) → void') isn't a subtype of 'MVCObject.values=' ('(Map<dynamic, dynamic>) → void'). (package:google_maps/src/generated/core/mvc/mvc_array.dart, line 90, col 3)
[error] The return type 'TypedJsArray' isn't a 'List<num>', as defined by the method 'coords'. (package:google_maps/src/generated/core/overlays/marker_shape.dart, line 24, col 27)
[error] The return type 'TypedJsArray' isn't a 'List<IconSequence>', as defined by the method 'icons'. (package:google_maps/src/generated/core/overlays/polyline_options.dart, line 32, col 35)
[error] The return type 'TypedJsArray' isn't a 'List<DirectionsStep>', as defined by the method 'steps'. (package:google_maps/src/generated/core/services/directions_leg.dart, line 40, col 37)
[error] The return type 'TypedJsArray' isn't a 'List<LatLng>', as defined by the method 'viaWaypoints'. (package:google_maps/src/generated/core/services/directions_leg.dart, line 42, col 36)
[error] The return type 'TypedJsArray' isn't a 'List<DirectionsWaypoint>', as defined by the method 'waypoints'. (package:google_maps/src/generated/core/services/directions_request.dart, line 44, col 45)
[error] The return type 'TypedJsArray' isn't a 'List<DirectionsRoute>', as defined by the method 'routes'. (package:google_maps/src/generated/core/services/directions_result.dart, line 24, col 39)
[error] The return type 'TypedJsArray' isn't a 'List<DirectionsLeg>', as defined by the method 'legs'. (package:google_maps/src/generated/core/services/directions_route.dart, line 28, col 35)
[error] The return type 'TypedJsArray' isn't a 'List<LatLng>', as defined by the method 'overviewPath'. (package:google_maps/src/generated/core/services/directions_route.dart, line 30, col 36)
[error] The return type 'TypedJsArray' isn't a 'List<String>', as defined by the method 'warnings'. (package:google_maps/src/generated/core/services/directions_route.dart, line 32, col 32)
[error] The return type 'TypedJsArray' isn't a 'List<num>', as defined by the method 'waypointOrder'. (package:google_maps/src/generated/core/services/directions_route.dart, line 34, col 34)
[error] The return type 'TypedJsArray' isn't a 'List<LatLng>', as defined by the method 'path'. (package:google_maps/src/generated/core/services/directions_step.dart, line 32, col 28)
[error] The return type 'TypedJsArray' isn't a 'List<DirectionsStep>', as defined by the method 'steps'. (package:google_maps/src/generated/core/services/directions_step.dart, line 36, col 37)
[error] The return type 'TypedJsArray' isn't a 'List<String>', as defined by the method 'destinationAddresses'. (package:google_maps/src/generated/core/services/distance_matrix_response.dart, line 24, col 44)
[error] The return type 'TypedJsArray' isn't a 'List<String>', as defined by the method 'originAddresses'. (package:google_maps/src/generated/core/services/distance_matrix_response.dart, line 26, col 39)
[error] The return type 'TypedJsArray' isn't a 'List<DistanceMatrixResponseRow>', as defined by the method 'rows'. (package:google_maps/src/generated/core/services/distance_matrix_response.dart, line 28, col 47)
[error] The return type 'TypedJsArray' isn't a 'List<DistanceMatrixResponseElement>', as defined by the method 'elements'. (package:google_maps/src/generated/core/services/distance_matrix_response_row.dart, line 24, col 55)
[error] The argument type 'TypedJsArray' can't be assigned to the parameter type 'List<ElevationResult>'. (package:google_maps/src/generated/core/services/elevation_service.dart, line 25, col 134)
[error] The argument type 'TypedJsArray' can't be assigned to the parameter type 'List<ElevationResult>'. (package:google_maps/src/generated/core/services/elevation_service.dart, line 28, col 137)
[error] The argument type 'TypedJsArray' can't be assigned to the parameter type 'List<GeocoderResult>'. (package:google_maps/src/generated/core/services/geocoder.dart, line 25, col 120)
[error] The return type 'TypedJsArray' isn't a 'List<String>', as defined by the method 'types'. (package:google_maps/src/generated/core/services/geocoder_address_component.dart, line 28, col 29)
[error] The return type 'TypedJsArray' isn't a 'List<GeocoderAddressComponent>', as defined by the method 'addressComponents'. (package:google_maps/src/generated/core/services/geocoder_result.dart, line 24, col 59)
[error] The return type 'TypedJsArray' isn't a 'List<String>', as defined by the method 'types'. (package:google_maps/src/generated/core/services/geocoder_result.dart, line 30, col 29)
[error] The return type 'TypedJsArray' isn't a 'List<LatLng>', as defined by the method 'locations'. (package:google_maps/src/generated/core/services/location_elevation_request.dart, line 24, col 33)
[error] The return type 'TypedJsArray' isn't a 'List<LatLng>', as defined by the method 'path'. (package:google_maps/src/generated/core/services/path_elevation_request.dart, line 24, col 28)
[error] The return type 'TypedJsArray' isn't a 'List<TransitAgency>', as defined by the method 'agencies'. (package:google_maps/src/generated/core/services/transit_line.dart, line 24, col 39)
[error] The return type 'TypedJsArray' isn't a 'List<StreetViewLink>', as defined by the method 'links'. (package:google_maps/src/generated/core/street_view/street_view_panorama.dart, line 59, col 37)
[error] The return type 'TypedJsArray' isn't a 'List<StreetViewLink>', as defined by the method 'links'. (package:google_maps/src/generated/core/street_view/street_view_panorama_data.dart, line 28, col 37)

Please fix all errors before compiling (warnings are okay).

  xhr.onreadystatechange    
a14n commented 7 years ago

Which version ?

marcinsydor commented 7 years ago

google_maps 3.2.1 angular2: 3.1.0

a14n commented 7 years ago

I cannot reproduce this issue. Moreover the first file ( google_maps/src/generated/core/layers/fusion_tables_layer_options.dart ) in your error logs doesn't exist in google_maps-3.2.1 package.

Is your projet visible/clonable somewhere ?

a14n commented 7 years ago

BTW I tested the example 01-basics/map-simple with pub build --web-compiler=dartdevc and it works well.

marcinsydor commented 7 years ago

Ok, I know where was the problem. When you asked me about the version I had setup google_maps to 'any'. For some reason, pub did not download the latest version but 2.something. So I had changed 'any' to '3.2.1'. But then I still had the same error. So I thought it did not work with the latest version as well. Few minutes ago I had to restard Webstorm and then when I run serve again and the map started working. So It had to be some caching problem. The app had to load version 2 instead of the latest one. It's a shame that I did not think about it before. Thanks for your help!