Skip to content

Playground from dev server does not load in Firefox #1196

Closed as not planned
Closed as not planned

Description

@brandonpayton

When using npm run dev, Firefox 115.9.1esr is unable to load Playground from http://localhost:5400/website-server/.

It starts loading but fails with the error:

TypeError: ServiceWorker script at http://localhost:5400/service-worker.ts?type=module&worker_file for scope http://localhost:5400/ threw an exception during script evaluation.

Here's a full screenshot:
image

I am unable to get further information on the error, but I believe the error is likely due to the fact that Firefox does not support ES modules as ServiceWorker scripts. See the support matrix on MDN.

Screenshot 2024-04-04 at 2 55 38 PM

Interestingly, Playground from playground.wordpress.net loads fine in Firefox . There we are still registering the ServiceWorker with type: "module", but https://playground.wordpress.net/sw.js does not appear to have any module-related syntax. A snapshot of the current, transpiled sw.js content can be found here.

Perhaps Firefox's lack of ServiceWorker module support is also causing #1180.

Activity

  1. bgrgicak commented on Apr 5, 2024

    @bgrgicak
    Collaborator

    This could be resolved by #1086

    I was able to get it to work in another project that uses Vite, but it required rewriting the SW registration to work with Vite PWA.

  2. brandonpayton commented on Apr 11, 2024

    @brandonpayton
    MemberAuthor

    Thank you for mentioning that @bgrgicak. Is it possible that our PWA work may help us solve this for "free"?

    Closing this issue as a duplicate of #330.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions