Angular-google-maps: Meteor angular 2 issue

Created on 28 Jun 2017  Â·  6Comments  Â·  Source: SebastianM/angular-google-maps

I ran into issue when i try to use @agm/core with meteor angular2. Everything is fine when i was with angular2-google-maps. But after @agm/installation i get an issue.
Help please !

stale

Most helpful comment

Add following to package.json in agm/core:
"main": "core.umd.js"
It is the same issue with other modules: Meteor build tool cannot find entry script to the plugin.

All 6 comments

And what is the issue?

Thanks for reply

I get this output from chrome console:
Uncaught SyntaxError: Unexpected token export
es5-shim.js?hash=4187fff…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at es5-shim.js?hash=4187fff…:17
at es5-shim.js?hash=4187fff…:2793
(anonymous) @ es5-shim.js?hash=4187fff…:17
(anonymous) @ es5-shim.js?hash=4187fff…:2793
promise.js?hash=32095b5…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at promise.js?hash=32095b5…:17
at promise.js?hash=32095b5…:586
(anonymous) @ promise.js?hash=32095b5…:17
(anonymous) @ promise.js?hash=32095b5…:586
babel-runtime.js?hash=490c91a…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at babel-runtime.js?hash=490c91a…:17
at babel-runtime.js?hash=490c91a…:164
(anonymous) @ babel-runtime.js?hash=490c91a…:17
(anonymous) @ babel-runtime.js?hash=490c91a…:164
ecmascript-runtime-client.js?hash=e1ad0a2…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at ecmascript-runtime-client.js?hash=e1ad0a2…:17
at ecmascript-runtime-client.js?hash=e1ad0a2…:110
(anonymous) @ ecmascript-runtime-client.js?hash=e1ad0a2…:17
(anonymous) @ ecmascript-runtime-client.js?hash=e1ad0a2…:110
random.js?hash=49bdca1…:18 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at random.js?hash=49bdca1…:18
at random.js?hash=49bdca1…:372
(anonymous) @ random.js?hash=49bdca1…:18
(anonymous) @ random.js?hash=49bdca1…:372
mongo-id.js?hash=345d169…:19 Uncaught TypeError: Cannot read property 'Random' of undefined
at mongo-id.js?hash=345d169…:19
at mongo-id.js?hash=345d169…:142
(anonymous) @ mongo-id.js?hash=345d169…:19
(anonymous) @ mongo-id.js?hash=345d169…:142
geojson-utils.js?hash=401d570…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at geojson-utils.js?hash=401d570…:17
at geojson-utils.js?hash=401d570…:443
(anonymous) @ geojson-utils.js?hash=401d570…:17
(anonymous) @ geojson-utils.js?hash=401d570…:443
minimongo.js?hash=4f5c421…:23 Uncaught TypeError: Cannot read property 'MongoID' of undefined
at minimongo.js?hash=4f5c421…:23
at minimongo.js?hash=4f5c421…:3974
(anonymous) @ minimongo.js?hash=4f5c421…:23
(anonymous) @ minimongo.js?hash=4f5c421…:3974
check.js?hash=a2540f9…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at check.js?hash=a2540f9…:17
at check.js?hash=a2540f9…:587
(anonymous) @ check.js?hash=a2540f9…:17
(anonymous) @ check.js?hash=a2540f9…:587
retry.js?hash=1e40961…:18 Uncaught TypeError: Cannot read property 'Random' of undefined
at retry.js?hash=1e40961…:18
at retry.js?hash=1e40961…:110
(anonymous) @ retry.js?hash=1e40961…:18
(anonymous) @ retry.js?hash=1e40961…:110
ddp-common.js?hash=d42359b…:17 Uncaught TypeError: Cannot read property 'check' of undefined
at ddp-common.js?hash=d42359b…:17
at ddp-common.js?hash=d42359b…:493
(anonymous) @ ddp-common.js?hash=d42359b…:17
(anonymous) @ ddp-common.js?hash=d42359b…:493
reload.js?hash=02487cd…:18 Uncaught TypeError: Cannot read property 'Symbol' of undefined
at reload.js?hash=02487cd…:18
at reload.js?hash=02487cd…:309
(anonymous) @ reload.js?hash=02487cd…:18
(anonymous) @ reload.js?hash=02487cd…:309
ddp-client.js?hash=c9ca220…:17 Uncaught TypeError: Cannot read property 'check' of undefined
at ddp-client.js?hash=c9ca220…:17
at ddp-client.js?hash=c9ca220…:5112
(anonymous) @ ddp-client.js?hash=c9ca220…:17
(anonymous) @ ddp-client.js?hash=c9ca220…:5112
ddp.js?hash=25dc3f4…:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at ddp.js?hash=25dc3f4…:14
at ddp.js?hash=25dc3f4…:27
(anonymous) @ ddp.js?hash=25dc3f4…:14
(anonymous) @ ddp.js?hash=25dc3f4…:27
allow-deny.js?hash=6360702…:18 Uncaught TypeError: Cannot read property 'LocalCollection' of undefined
at allow-deny.js?hash=6360702…:18
at allow-deny.js?hash=6360702…:557
(anonymous) @ allow-deny.js?hash=6360702…:18
(anonymous) @ allow-deny.js?hash=6360702…:557
mongo.js?hash=f19f5d3…:17 Uncaught TypeError: Cannot read property 'AllowDeny' of undefined
at mongo.js?hash=f19f5d3…:17
at mongo.js?hash=f19f5d3…:868
(anonymous) @ mongo.js?hash=f19f5d3…:17
(anonymous) @ mongo.js?hash=f19f5d3…:868
jquery.js?hash=0c5fac3…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at jquery.js?hash=0c5fac3…:17
at jquery.js?hash=0c5fac3…:10425
(anonymous) @ jquery.js?hash=0c5fac3…:17
(anonymous) @ jquery.js?hash=0c5fac3…:10425
twbs_bootstrap.js?hash=2ee228e…:17 Uncaught TypeError: Cannot read property '$' of undefined
at twbs_bootstrap.js?hash=2ee228e…:17
at twbs_bootstrap.js?hash=2ee228e…:2401
(anonymous) @ twbs_bootstrap.js?hash=2ee228e…:17
(anonymous) @ twbs_bootstrap.js?hash=2ee228e…:2401
http.js?hash=d7408e6…:19 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at http.js?hash=d7408e6…:19
at http.js?hash=d7408e6…:331
(anonymous) @ http.js?hash=d7408e6…:19
(anonymous) @ http.js?hash=d7408e6…:331
dynamic-import.js?hash=d3e0fe1…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at dynamic-import.js?hash=d3e0fe1…:17
at dynamic-import.js?hash=d3e0fe1…:420
(anonymous) @ dynamic-import.js?hash=d3e0fe1…:17
(anonymous) @ dynamic-import.js?hash=d3e0fe1…:420
webapp.js?hash=7e17845…:18 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at webapp.js?hash=7e17845…:18
at webapp.js?hash=7e17845…:68
(anonymous) @ webapp.js?hash=7e17845…:18
(anonymous) @ webapp.js?hash=7e17845…:68
livedata.js?hash=7cf1831…:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at livedata.js?hash=7cf1831…:14
at livedata.js?hash=7cf1831…:31
(anonymous) @ livedata.js?hash=7cf1831…:14
(anonymous) @ livedata.js?hash=7cf1831…:31
autoupdate.js?hash=1fd9cf3…:19 Uncaught TypeError: Cannot read property 'Retry' of undefined
at autoupdate.js?hash=1fd9cf3…:19
at autoupdate.js?hash=1fd9cf3…:206
(anonymous) @ autoupdate.js?hash=1fd9cf3…:19
(anonymous) @ autoupdate.js?hash=1fd9cf3…:206
barbatus_typescript-runtime.js?hash=d524120…:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
at barbatus_typescript-runtime.js?hash=d524120…:17
at barbatus_typescript-runtime.js?hash=d524120…:326
(anonymous) @ barbatus_typescript-runtime.js?hash=d524120…:17
(anonymous) @ barbatus_typescript-runtime.js?hash=d524120…:326
global-imports.js?hash=716aef0…:3 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at global-imports.js?hash=716aef0…:3
(anonymous) @ global-imports.js?hash=716aef0…:3
app.js?hash=4d53366…:1 Uncaught ReferenceError: meteorInstall is not defined
at app.js?hash=4d53366…:1
(anonymous) @ app.js?hash=4d53366…:1

My angular module is:
`
import { NgModule, OnInit } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { CommonModule } from "@angular/common";
import { HomePage } from "./page/home.page";
import { AgmCoreModule } from "@agm/core";
import { HomeComponents } from "./component";

@NgModule({
imports: [CommonModule, AgmCoreModule.forRoot({
apiKey: "xxxxxx"
})
],
declarations: [HomePage, HomeComponents]
})
export class HomeModule {};
`

And the map component is here:
`
import { Component, OnInit, Input } from "@angular/core";
import template from "./map.component.html";
import style from "./map.component.scss";
import { PolygonManager } from "@agm/core";

@Component({
selector: "ms-map",
template,
styles: [style]
})
export class MyMap implements OnInit{
@Input() title: string;
@Input() polygones: any;
lat: number;
lng: number;
paths: any;

constructor(){}

ngOnInit(){
    this.lat = xxxx;
    this.lng = yyy;
    this.paths = [];
    console.log(this.polygones, this.paths);
}

}
`
It is the same as in this issue: https://github.com/Urigo/angular-meteor/issues/1578 or here https://stackoverflow.com/questions/42570396/angular2-meteor-cant-read-property-meteorinstall
But as i said, thing were fine with angualar2-google-map and when i remove '@ agm/core' from the module script, the issue go away.

Add following to package.json in agm/core:
"main": "core.umd.js"
It is the same issue with other modules: Meteor build tool cannot find entry script to the plugin.

I have the same problem (in Firefox, the error message is "export declarations may only appear at top level of a module"). The error occurs at the export statements in index.js.
I can confirm that the workaround above (adding "main": "core.umd.js" to package.json) solves the error.

on @agm/[email protected], still waiting for a proper fix.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcelinobadin picture marcelinobadin  Â·  3Comments

gizm0bill picture gizm0bill  Â·  4Comments

PeterSisovsky picture PeterSisovsky  Â·  3Comments

nthonymiller picture nthonymiller  Â·  4Comments

alexweber picture alexweber  Â·  4Comments