Learn how to fix the FetchEvent.respondWith error on Safari to make your PWA work offline
This article was originally posted on dev.toRecently I have been working on a PWA for a client. I chose to use Gatsby to build out the front end and luckily it comes with some great plugins to help with building PWAs. Mainly the offline and manifest plugins. After configuring those and building out the proof of concept, I deploy the site to Netlify and started testing on different devices. It all goes off without a hitch until I get to iPad Safari… Where after adding the app to the Home Screen and playing around with it, I turn off my wifi to test the offline mode. And I am met with this lovely error:
Hello World
of PWAs. Literally. Anyway, I followed the tutorial, deployed on Netlify and proceeded to test on iPad, with no issues! So something was wrong with the Gatsby build and not the iPad.
I made two changes to my project, which were all pushed at the same time and ended up fixing my issue. In all honesty, I am not 100% sure which one was the actual fix and at this point, I am too scared to test.
<head>
of your pages, and seeing if it fixes your issue.
apple-mobile-web-app-capable
.
globPatterns
gatsby-config.js
file, I updated the manifest plugin options to include cache_busting_mode: 'none'
, which is required when you specify a new globPattern
. Then under the offline plugin I updated the workboxConfig to be: