Skip to content

Use service worker on localhost #268

@Everettss

Description

@Everettss

Current Build Setup serve from http://localhost:8080/ but in entry-server.js is

// service worker
if ('https:' === location.protocol && navigator.serviceWorker) {
  navigator.serviceWorker.register('/service-worker.js')
}

There is problem with 'https:' === location.protocol on localhost.
Is this check really needed? It introduce unnecessary complexity of need serving from https on localhost. If you remove this check and run on http not on localhost it will simple throw an error - for me this should be expected behaviour (developer will easily spot this problem) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions