visgl / visgl/react-google-maps
[Bug] AdvancedMarker fires "TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node' when "draggable" is true
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 193
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 13
Description
Description
My stack:
- React 18.3.1
- @vis.gl/react-google-maps 1.7.1
- vite 6.0.7
The code:
<AdvancedMarker
position={markerCoordinates}
// draggable
// onDragEnd={getGeocodeData}
collisionBehavior={CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL}
anchorTop="-90%"
>
<img src={mapPinIcon} alt="pin" />
</AdvancedMarker>
The error:
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'
This error is getting caused by using the draggable prop on the AdvancedMarker. Removing the prop doesnt cause the crash.
mapPinIcon is a .svg image.
I've tried making a workaround to this by ensuring that AdvancedMarker was getting a Node child, by creating a container with document.createElement and appending an image with appendChild, but it still gives that error.
Steps to Reproduce
In a closed environment it works... So providing a CodeSandbox seems worthless. If you need any kind of additional information I'll provide it ASAP as I'll be looking at this issue constantly
Environment
- Library version: 1.7.1 (tried also 1.5.1 and 1.5.2)
- Google maps version: weekly
- Browser and Version: Chrome 142.0.7444.60
- OS: MacOS Tahoe 26.0.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the AdvancedMarker entry point and reproduce the reported appendChild error with React 18.3.1, @vis.gl/react-google-maps 1.7.1, draggable enabled, and an SVG image child. Compare behavior with draggable removed; done means identifying and fixing the cause without the crash and confirming the behavior with a reproducible test case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100