Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular Google Maps (@agm/core) - Unexpected token export #171

Closed
Alucardz opened this issue Oct 16, 2017 · 8 comments
Closed

Angular Google Maps (@agm/core) - Unexpected token export #171

Alucardz opened this issue Oct 16, 2017 · 8 comments

Comments

@Alucardz
Copy link

Alucardz commented Oct 16, 2017

Getting the following error when testing simple example from https://angular-maps.com/guides/getting-started/ :

Unexpected token export
Evaluating https://unpkg.com/@agm/core@1.0.0-beta.1/index.js

Can test here: https://angular-google-maps-example.stackblitz.io

Could this be related to #131 ? Although I'm not using AngularFire2 in the above example.

Could possibly be related to sebholstein/angular-google-maps#1052 even though this is a more Angular Universal issue...

@Alucardz Alucardz changed the title Angular Google Maps (@agm/core) error Angular Google Maps (@agm/core) - Unexpected token export Oct 16, 2017
@Alucardz
Copy link
Author

Any insight into this?

@EricSimons
Copy link
Member

Hey @Alucardz! So sorry about my delay here, the past week or so has been nuts 😅 It looks like this is actually a problem with the package itself — specifically it doesn't have a main field that points to its CJS bundle. Instead, if you import import { AgmCoreModule } from '@agm/core/core.umd'; (core.umd.js is the main bundle) everything works great! Here's a fork of your project that's working properly: https://stackblitz.com/edit/angular-google-maps-example-9neueh?file=app%2Fapp.module.ts

Lmk if that works for ya or if you run into any other troubles!

@Alucardz
Copy link
Author

Wow that's awesome, kudos for the amazing platform and superb support!

@Alucardz
Copy link
Author

Alucardz commented Oct 26, 2017

Would there be any reason that 2 UMD modules included together, for example:

import { AgmCoreModule } from '@agm/core/core.umd';
import { AgmSnazzyInfoWindowModule } from '@agm/snazzy-info-window/snazzy-info-window.umd';

along with:

AgmCoreModule.forRoot({
      apiKey: environment.googleMapsAPiKey
}),
AgmSnazzyInfoWindowModule

would cause the same error but on BOTH umd files?

Fatal error:
Unexpected token export
Evaluating https://unpkg.com/@agm/core@1.0.0-beta.1/index.js
Evaluating https://unpkg.com/@agm/snazzy-info-window@1.0.0-beta.1/snazzy-info-window.umd.js
Evaluating app/app.module.ts
Evaluating main.ts
Loading app

The way I'm reasoning about it is that the snazzy-info-window.umd.js file is referencing the non-UMD version of the agm/core... which is what is breaking the whole thing, right?

@EricSimons
Copy link
Member

@Alucardz yup you're totally right about this — I think I've figured out a way to fix this from happening :) I've got it running locally right now but need to do some more testing before I send it to prod, shooting to have it on prod tmrw 😅 So sorry about the inconvenience!!

@Alucardz
Copy link
Author

@EricSimons It's working marvelously now, looks like you pushed the fix to prod :) Kudos to you sir!

@HighSoftWare96
Copy link

Not working for me... I'm getting this:
ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'AgmCoreModule' was called.

@EigenTheory
Copy link

This is happening again, does anyone have a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants