Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xMokAx
Copy link

@xMokAx xMokAx commented Jan 17, 2019

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

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.

None yet

2 participants