PWA Not working on Netlify
See original GitHub issueDescription
I followed the steps on https://www.gatsbyjs.org/docs/progressive-web-app/ to create a Gatsby PWA, and it worked in development using gatsby build && gatsby serve
but in the Netlify deploy preview the service worker fails to register, this is the error The installing service worker became redundant.
Steps to reproduce
Unsure how to reproduce in another project but to see the issue
- open the repo in Gitpod
- Open in browser
- See PWA installable
- Open the [deploy preview]
- See the logs say that it failed
Alternatively, here are the screenshots
Development
Deploy Preview
Expected result
PWA should be insatllable on Netlify just like it was previously in a production build.
Actual result
Weird error that is not consistent with the production gatsby build
Environment
System:
OS: Linux 4.14 Ubuntu 20.04 LTS (Focal Fossa)
CPU: (16) x64 Intel(R) Xeon(R) CPU @ 2.20GHz
Shell: 5.0.16 - /bin/bash
Binaries:
Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.3/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
Languages:
Python: 2.7.17 - /home/gitpod/.pyenv/shims/python
npmPackages:
gatsby: 2.19.7 => 2.19.7
gatsby-image: 2.2.39 => 2.2.39
gatsby-plugin-algolia-docsearch: ^1.0.5 => 1.0.5
gatsby-plugin-canonical-urls: 2.1.19 => 2.1.19
gatsby-plugin-catch-links: 2.1.24 => 2.1.24
gatsby-plugin-emotion: 4.1.21 => 4.1.21
gatsby-plugin-exclude: ^1.0.2 => 1.0.2
gatsby-plugin-feed: ^2.3.26 => 2.3.26
gatsby-plugin-google-analytics: 2.1.34 => 2.1.34
gatsby-plugin-manifest: ^2.4.3 => 2.4.3
gatsby-plugin-offline: ^3.2.2 => 3.2.2
gatsby-plugin-react-helmet: 3.1.21 => 3.1.21
gatsby-plugin-sharp: 2.4.3 => 2.4.3
gatsby-plugin-sitemap: 2.2.26 => 2.2.26
gatsby-plugin-typescript: 2.1.26 => 2.1.26
gatsby-remark-autolink-headers: 2.1.23 => 2.1.23
gatsby-remark-copy-linked-files: 2.1.36 => 2.1.36
gatsby-remark-embed-video: ^2..1 => 2.0.1
gatsby-remark-external-links: ^0.0.4 => 0.0.4
gatsby-remark-images: 3.1.42 => 3.1.42
gatsby-remark-prismjs: 3.3.30 => 3.3.30
gatsby-remark-responsive-iframe: 2.2.31 => 2.2.31
gatsby-remark-smartypants: 2.1.20 => 2.1.20
gatsby-source-filesystem: 2.1.46 => 2.1.46
gatsby-transformer-json: 2.2.25 => 2.2.25
gatsby-transformer-remark: 2.6.48 => 2.6.48
gatsby-transformer-sharp: 2.3.13 => 2.3.13
npmGlobalPackages:
gatsby-cli: 2.12.21
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React PWA Service Worker works locally, but not when hosted ...
I'm trying to learn more about PWA Service Workers and wanted to implement that feature on this personal project site I'm working on....
Read more >PWA start_url constent issue - Netlify Support Forums
min.js (or anywhere else), does not seem to have the service worker registration code. It should be something like: navigator.serviceWorker.
Read more >Building a PWA with Netlify Functions - David Bushell
Inspiration: I've been having a problem with short URLs recently. They'll often redirect through tracking domains that are purposefully blocked ...
Read more >React PWA Issue - Netlify
1. Make sure you have google drive on the phone but not logged in. 2. Click "Choose File". It will show you the...
Read more >Deployment - Vue CLI
... so it will not work if you open dist/index.html directly over file:// ... If you are using the PWA plugin, your app...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report! I’ve assigned our Learning team to review this and get back to you. Thanks!
I don’t think this is an issue with GitHub but rather with Netlify and/or your deployment. See https://community.netlify.com/t/workbox-error-precachecontroller-mjs-194-uncaught-in-promise-bad-precaching-response-redirects-wb-revision-404/8865/9 and https://github.com/GoogleChrome/workbox/issues/2179#issuecomment-519664678.
You can adjust the workboxConfig if needed.