question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PWA Not working on Netlify

See original GitHub issue

Description

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

  1. open the repo in Gitpod
  2. Open in browser
  3. See PWA installable
  4. Open the [deploy preview]
  5. See the logs say that it failed

Alternatively, here are the screenshots

Development

image

Deploy Preview

image

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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
blainekastencommented, May 18, 2020

Thanks for the report! I’ve assigned our Learning team to review this and get back to you. Thanks!

0reactions
LekoArtscommented, Jun 16, 2020
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found