[Bug] Internal script error when Google Maps API is loaded from user cache
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- react, typescript
調査の方向性
importLibrary のスタブ実装と、レポートで言及されている example ディレクトリから始めます。ダウンロードした 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日 11時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
visgl/react-google-maps のほかの issue
-
google maps issue
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
visgl/react-google-maps#1080 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug needs more info
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
visgl/react-google-maps#1039 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
visgl/react-google-maps#918 · コメント 9 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
visgl/react-google-maps#905 ·
メンテナーはふだん 2 日以内に返信
-
google maps issue
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
visgl/react-google-maps#889 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
visgl/react-google-maps の issue をすべて見る
似ている issue
-
priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
prime-radiant-inc/evener#3291 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto-cli#14961 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
supabase/agent-skills#614 ·
-
Content
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
RunestoneInteractive/rs#1559 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信