Skip to content

A registered service worker breaks development #2272

Closed
@Timer

Description

@Timer

If you happen to run serve -s build and it installs a localhost service worker, all future development is borked (no page reloading).

We need to fix this problem... do we need to add something like this?

if (process.env.NODE_ENV === 'development') {
  navigator.serviceWorker.getRegistrations().then(function(registrations) {
    for (let registration of registrations) {
      registration.unregister()
    }
  })
}

I believe the docs mention this, but it's super annoying.

/cc @jeffposnick

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions