Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] Internal script error when Google Maps API is loaded from user cache

オープン
#877 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
react, typescript
領域
api, frontend

調査の方向性

importLibrary のスタブ実装と、レポートで言及されている example ディレクトリから始めます。ダウンロードした Google Maps スクリプトの有効期限が切れた後、Chrome のローカルオーバーライドを使ってキャッシュされたスクリプトのケースを再現し、その後ランタイムエラーと依存関係の削除を追跡します。完了条件は、未捕捉エラーを理解し、マップの正常な初期化を壊さずに影響を受けるロードパスを処理できることです。

索引モデルが issue の本文から書いたものです。

説明

bug
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.maps dependencies 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&region=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 /example directory 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

visgl/react-google-maps のほかの issue

visgl/react-google-maps の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。