Skip to content

fix app crash because google is undefined in a PWA if the user is offline and cache is disabled.#956

Open
xMokAx wants to merge 1 commit into
tomchentw:masterfrom
xMokAx:master
Open

fix app crash because google is undefined in a PWA if the user is offline and cache is disabled.#956
xMokAx wants to merge 1 commit into
tomchentw:masterfrom
xMokAx:master

Conversation

@xMokAx

@xMokAx xMokAx commented Jan 17, 2019

Copy link
Copy Markdown

When i open my app in offline mode if https://maps.googleapis.com/maps/api/js is not available in browser cache like disk cache the app craches because google is not defined.
You can see the error here https://xmokax.github.io/map-app/ by following these steps:

  1. open the app and wait for service worker to install and finish precaching assets.
  2. reload the page and then go to the network tab in the developer tools and choose offline then reload the app. The app will work because google maps script will be served from disk cache.
  3. go to network tab in developer tools and choose both offline and disable cache too then reload the page the app will crash because google is not defined.

This PR to fixes this problem.

@JustFly1984

Copy link
Copy Markdown

Hello @xMokAx this repo is unmaintained, and pull requests does not merged since more than a year. Please consider to use a successor library react-google-maps-api https://github.com/JustFly1984/react-google-maps-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants