Uncaught TypeError: Illegal constructor in AdvancedMarker nextjs 14 #225
-
I am getting this error in nextjs 14 when I open the page first time . I have a search page for places when I redirect to search It browser gives me this error and If I refresh the page It works fine
Here is the code. I want to highlight when hover on placelocation card
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
On dev it is saved my life. I was sitting 4h to undestand, why my new Marker isnt working, but map is. Then, readed that and launched production, and guess what, it was working entire time :/ *Thank you |
Beta Was this translation helpful? Give feedback.
As for the error-message, that is something coming from the maps API. I think I've seen something like that before when the maps API was accidentally loaded multiple times. Creating an instance of an unregistered web-component will trigger this error:
This can happen when the maps API is loaded multiple times since the custom elements (
<gmp-advanced-marker>
) can only be defined once. After loading the api a second time the new element classes can't get registered (th…