Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Async loading and google global error. #1853

Open
xavhan opened this issue May 17, 2016 · 31 comments
Open

Async loading and google global error. #1853

xavhan opened this issue May 17, 2016 · 31 comments

Comments

@xavhan
Copy link

xavhan commented May 17, 2016

Since I upgraded to 2.3.3 I got 4 errors at loading time.

Uncaught ReferenceError: google is not defined @ markerwithlabel.js:71
Uncaught ReferenceError: google is not defined @ infobox.js:116
Uncaught ReferenceError: google is not defined @ keydragzoom.js:820
Uncaught ReferenceError: google is not defined @ richmarker.js:60 

It seems to be caused by the async loading of the google maps API.
I saw that

angular.module('uiGmapgoogle-maps.mocks', ['uiGmapgoogle-maps'])
try to mock those but it isn't working.

Bonus : Goal of making those lib dependencies is, I think, to make them optional. Is it doable today?

@marcschregardus
Copy link

I'm getting the same problem - and my elements no longer display.

@kdkade
Copy link

kdkade commented May 19, 2016

If there is no way to fix this ATM, can someone tell me which is the latest stable version without that problem?

@Qwerios
Copy link

Qwerios commented May 19, 2016

@kdkade We fixated our version to 2.3.2 for now which restored functionality

@nebulr
Copy link

nebulr commented May 19, 2016

I am receiving the same problem. Why were these additional dependencies required?

@kdkade
Copy link

kdkade commented May 20, 2016

@Qwerios Thanks, did the same and I confirm it solves the issue.

@lfreneda
Copy link

same here.. thanks @Qwerios
lets wait the fix for v2.3.3 🍟

@willcrisis
Copy link

Same error here on version 2.3.3. Downgraded to 2.3.2 and everything works great.

@holaontiveros
Copy link

Same here, but i get the error even in 2.3.2

@jatinwaichal
Copy link

I had the same problem with latest update for google maps.

But after downgrading to 2.3.2 it works fine now.

@heoheoyh
Copy link

After clone project in my github, i'm getting same problem on version 2.3.2

@lfreneda
Copy link

lfreneda commented Jun 10, 2016

2.3.2 is working ok for me D:

@heoheoyh have u tried cleaning bower/npm cache or simply rm -rf bower_components/ ?

@heoheoyh
Copy link

@lfreneda it was my mistake..! my version was 2.3.3 and I had reinstalled exactly 2.3.2 version. It is ended up working!

@sinedied
Copy link

I also have the issue, but maybe I can add that I'm using bower with main-bower-files, if it can help.

As everyone, works fine in 2.3.2. Any news?

@Splaktar
Copy link
Contributor

I couldn't downgrade because 2.3.2 has broken cluster images which my site depends on. I was able to hack it for now by adding the script tag into the index.html without async defer:

    <!-- Hack to fix exceptions caused by latest version of angular-google-maps -->
    <script src="https://maps.googleapis.com/maps/api/js"></script>

This probably isn't a good thing in the long run, especially loading it without an API key, but it got my site back up and running tonight. I tried to look at making a fix to the library itself, but I have no interest in dealing with CoffeeScript.

@doc82
Copy link

doc82 commented Jul 15, 2016

@Splaktar 's workaround was awesome except it wouldn't work with mocha... Downgrading to 2.3.2 was the only thing that allowed unit tests to pass.

@joshuawoodward
Copy link

joshuawoodward commented Jul 18, 2016

The problem lies in this commit I believe cb667cb#diff-0a08a7565aba4405282251491979bb6b - https://github.com/angular-ui/angular-google-maps/blob/cb667cb7b55a607929537a2fd8250613e38e9be3/bower.json

Those 4 new dependencies are looking for 'google' to be defined, however the maps api is loaded until after...using the async loader

@StepEnquero
Copy link

Hi, even after downgrading to 2.3.2, its not working. Please check this plunker -
http://plnkr.co/edit/AJpJxBHF1SpwCtRKEzPF?p=preview

I have changed the angular-google-maps to v2.3.2.

Please let me know if you are able to resolve this. Thanks.

@sinedied
Copy link

Is anyone looking into this issue? This is problematic for production projects, please at least revert the latest nam package to be the 2.3.2 (working) version, to avoid issues.

@StepEnquero
Copy link

Add the tag - <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> and it shouldn't break

@ziarno
Copy link

ziarno commented Sep 28, 2016

Thanks, works after downgrading to 2.3.2!

@MadJlzz
Copy link

MadJlzz commented Oct 12, 2016

Same problem in 2.4.0. I had to downgrade into 2.3.2 as suggested by many of you. Thanks.

@Fonta
Copy link

Fonta commented Oct 15, 2016

Same here, when using 2.4.0 I get the google not defined error. 2.3.2 works fine!

@OR13
Copy link

OR13 commented Oct 19, 2016

downgrading to 2.3.2 resolved this issue for me as well.

@almothafar
Copy link

almothafar commented Dec 25, 2016

I got the same issue on version 2.4.0 but downgraded again to 2.3.2, and worked again.

But I noticed something, when I downgraded the version, and I run the bower prune command:

bower prune
bower uninstall google-maps-utility-library-v3-infobox
bower uninstall google-maps-utility-library-v3-keydragzoom
bower uninstall google-maps-utility-library-v3-markerwithlabel
bower uninstall js-rich-marker
bower uninstall markerclustererplus

Why? I think those files involved with issue somehow.

@SamuelToh
Copy link

Same here.

The furthest version which work for me is version 2.3.2. Anything above that it just crashes with the error.
Anyone has any luck with it?

@woyehenni
Copy link

Same here, when using 2.4.1 I get the google not defined error. 2.3.2 works fine!

@elensky
Copy link

elensky commented May 26, 2017

The same issue.
For me it happens because of automatic injection of dependencies. I guess markerwithlabel.js, infobox.js, keydragzoom.js and richmarker.js try to call google api after angular-google-maps adds api script on page. So it is just my supposition, but I hope I can help to investigate this.

@shinusuresh
Copy link

Downgrading to 2.3.2 works for me as well

@olexam
Copy link

olexam commented Aug 28, 2017

Hi, had the same problem with 2.4.1 version.

Seems I found solution by overriding dependency in bower.json that works for me:

"overrides": {
    "angular-google-maps": {
      "dependencies": {
        "angular": "1.5.8",
        "angular-simple-logger": "0.1.7"
      }
    }
}

Please note that angular-simple-logger is still required

@marciobrst
Copy link

marciobrst commented Feb 2, 2018

perfect, works for me @olexam

@rurquia
Copy link

rurquia commented Mar 22, 2018

thanks @olexam you made my day! ^^

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

No branches or pull requests