Skip to content

Uncaught TypeError: Illegal constructor in AdvancedMarker nextjs 14 #225

Closed Answered by usefulthink
Lalman888 asked this question in Q&A
Discussion options

You must be logged in to vote

A quick note upfront: your API key was visible as part of the stacktrace. I edited it out, but you should probably delete it and create a new one unless it is properly secured and tied to a limited set of APIs and Domains.

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…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Lalman888
Comment options

Answer selected by Lalman888
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants