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

Google Maps script is loaded twice #10

Open
gorankrgovic opened this issue Oct 18, 2018 · 8 comments
Open

Google Maps script is loaded twice #10

gorankrgovic opened this issue Oct 18, 2018 · 8 comments

Comments

@gorankrgovic
Copy link

For some reason on my Nuxt spa app, the module loads the maps script twice giving the following error in console:

You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.

I'm not using any other method to fetch the Google maps API apart from this module and the configuration is:

 ['nuxt-google-maps-module', {
      key: 'my-google-maps-api-key'
    }]
@KaniRobinson
Copy link

Are there any updates on this?

@felixdenoix
Copy link

@gorankrgovic @KaniRobinson
Could this answer be of any help by any chance ?
nuxt/nuxt#138 (comment)

@AGrinx
Copy link

AGrinx commented May 3, 2019

Hi guys,
I have the same issue with You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
I use mode=spa so it is not related to server-side

@conseromarketing
Copy link

Having the same issue. Did anyone solve this problem?

@felixdenoix
Copy link

felixdenoix commented Aug 22, 2019

@propsoft I did a fork and changed a few things ! Appears to be working...
I do not guarantee anything and you probably should fork it and review the code before using it ! (you can then install it from your own repo using npm install <git-host>:<git-user>/<repo-name>)

@shainegordon
Copy link

@felixdenoix was the only change really in /lib/module.js, the removal of the async on the exported function?

felixdenoix/nuxt-gmaps-custom@827279f...be85f70

@felixdenoix
Copy link

felixdenoix commented Sep 16, 2019

@shainegordon as well as adding build targets for ie 11 and changing the way the maps object is injected in the window around here if I'm not mistaken !

@harlet
Copy link

harlet commented Mar 29, 2020

Mine is working as expected, maybe because I use the maps option on the nuxt root config. ¯\(ツ)

modules: [
    // https://github.com/WilliamDASILVA/nuxt-google-maps-module
    'nuxt-google-maps-module'
],
maps: {
    key: 'CODE'
}

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

7 participants