TypeError: class constructors must be invoked with 'new'
Hello, Recently, I have been experiencing a problem when using GMAP3. On sites where I have been using GMAP3 for a long time I suddenly got the following error: "Uncaught (in promise) TypeError: class constructors must be invoked with 'new'"
This error hits line 155 from the latest version 7.2: return cls.apply(this, args);$
I also see that this problem occurs when running the code on the home page of GMAP3.
Can someone help me solve this problem?
same here on some sites we are using gmap3 ... 🤔
Now I've had the time to look into this issue ... error comes from latest Google Maps JS API change - 3.54.1. Latest working Version is: 3.53.13
So requesting this Version is my workaround for now:
<script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3.53.13&language=de&key=apiKey"></script>
Hi futureweb, thx for the answer. For now this workaround will help me out!
Replacing the gmElement function with the code below fixes the issue for me:
function gmElement(name) {
const cls = gm[name];
const args = slice(arguments, 1);
return Reflect.construct(cls, args);
}