[Bug] Internal script error when Google Maps API is loaded from user cache
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- react, typescript
调研方向
从 importLibrary 的存根实现和报告中提到的示例目录开始。在下载的 Google Maps 脚本过期后,使用 Chrome 本地覆盖重现缓存脚本场景,然后跟踪运行时错误和依赖项移除。完成的标准是理解未捕获错误,并在不破坏地图成功初始化的情况下处理受影响的加载路径。
由索引模型根据 Issue 内容生成。
描述
Description
This is an interesting error. We get about 400 instances daily with a high traffic site- considered pretty low frequency.
Error: Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError https://developers.google.com/maps/documentation/javascript/error-messages#not-loading-api-from-google-maps-error.
Commonalities:
- Browser-cached instance of the Google Maps API is loaded
- Error is thrown on a successful load, during runtime
- Common error is in:
https://maps.googleapis.com/maps-api-v3/api/js/61/14/main.js
TypeError: Cannot read properties of undefined (reading 'getRootNode')
^ Likely because the internal map element has suddenly been removed from the DOM by another script included by google.
Why it's an issue:
- Standard errors in requesting the google maps API are handled, this is uncaught due to
google.mapsdependencies suddenly being deleted from the global scope- as a result of the above error. After the script is loaded and dependencies are requested, and after the map has initialized in the DOM.
Area of current interest:
My current guess is that it's a race condition in the importLibrary stub implementation, that's an issue specifically when the core maps library is loaded immediately due to the cache and the cache is considered "outdated" by googles definition somewhere in their importLibrary (or similar) implementation.
Steps to Reproduce
This is difficult.
- Download a copy of:
https://maps.googleapis.com/maps/api/js?key={YOUR_KEY_HERE}&language=en®ion=GB&libraries=core%2Cmaps%2Cgeometry&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__
(with your API key) - Wait. This version of the script will expire at some point, my best guess at the moment is > 24hrs, but not sure yet.
- Use a local override to override the content of the script on an
/exampledirectory or similar
Environment
- Library version:
^1.7.1 - Google maps version: weekly
- Browser and Version: Chrome, Safari, Edge - any and all versions
- OS: Linux, iOS, macOS, Android, Windows - any and all
Logs
Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError
https://developers.google.com/maps/documentation/javascript/error-messages#not-loading-api-from-google-maps-error
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 195
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
visgl/react-google-maps 的其他 Issue
-
bug needs more info
难度 3/5 1-2 天 新手友好度 45/100
visgl/react-google-maps#1039 · 1 条评论 ·
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 35/100
visgl/react-google-maps#918 · 9 条评论 ·
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 45/100
visgl/react-google-maps#905 ·
维护者通常 3 天内回复
-
google maps issue
难度 3/5 1-2 天 新手友好度 45/100
visgl/react-google-maps#889 · 1 条评论 ·
维护者通常 3 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 35/100
visgl/react-google-maps#884 · 1 条评论 ·
维护者通常 3 天内回复
查看 visgl/react-google-maps 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
rohitg00/agentmemory#1428 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
boxlite-ai/boxlite#1729 ·
维护者通常 1 天内回复
-
detectors enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
SM260845/readme-gen#1 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
angular/angularfire#3774 ·
维护者通常 2 天内回复