Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] "AdvancedMarkerElement: map invalid: not an instance of MapsApiMap"

未关闭
#540 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
react, typescript
领域
frontend

调研方向

从链接的 CodeSandbox 及其多页面 Map 和 TooltipMarker 设置开始,然后在复现页面切换期间间歇性出现的 map-invalid 错误时检查 AdvancedMarker 集成。完成的标准是确定并解决该问题,使错误不再出现在复现的设置中;如果现有测试入口适用,还应包含相关的回归测试覆盖。

由索引模型根据 Issue 内容生成。

描述

bug
Description

We keep getting this error:

AdvancedMarkerElement: map invalid: not an instance of MapsApiMap

I'm not sure what's causing this issue to occur, but we keep running into it. There are a few things to note about our usage:

  • We're using the AdvancedMarker to create a TooltipMarker component
  • Our app renders a list of pages, each with their own Map, each receiving a unique location

At first I thought the error was perhaps being caused by some mounting/unmounting behavior that happens when switching between pages, or by how we implemented TooltipMarker, but I'm honestly not sure.

Steps to Reproduce

https://codesandbox.io/p/sandbox/advancedmarker-example-cyycp9

Getting the error to show up consistently is... not easy. The codesandbox linked above shows how the app is set up at a basic level, i.e. multiple pages rendering their own Map and a basic TooltipMarker implementation using AdvancedMarker.

Environment
  • Library version: 1.1.1
  • Google maps version: weekly
  • Browser and Version: Chrome 128
  • OS: Mac
Logs

No response

主要语言
TypeScript
星标
1.9k
派生
195
平均合并
2 天 11 小时
30 天内合并 PR
14

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

visgl/react-google-maps 的其他 Issue

查看 visgl/react-google-maps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。