Skip to content

Samsung Internet browser throws an error when cached resources get requested #1435

@Schepp

Description

@Schepp

Library Affected:
workbox-sw 3.0.0

Browser & Platform:
Samsung Internet 6.4.10.5

Issue or Feature Request Description:
I created a Service Worker with the help of Workbox. This is the SW's source code:

https://gist.github.com/Schepp/adbc1579e8d1a38087e087a40b205322

This is the page in which context it is running:
https://templates.park.works
User: templates
PW: gera16

Upon page load, I perform a SW precaching of HTML pages, by searching all <a> elements for URLs and by prefetching them via <link rel="prefetch"> element. When idle the browser fetches these URLs and the SW then caches them in the background (see source code above).

This works well on Chrome and Safari. On Samsung Internet though, the page only works upon the first visit. Once I reload the page, or navigate to a linked page, this is what I get:

image

When I look into Samsung Internet's internet://serviceworker-internals I spot these error messages:

Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}
Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}
Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}
Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}
Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}
Console: {"lineNumber":0,"message":"The FetchEvent for \"https://templates.park.works/\" resulted in a network error response: the promise was rejected.","message_level":2,"sourceIdentifier":1,"sourceURL":""}
Console: {"lineNumber":1,"message":"Uncaught (in promise) InvalidStateError: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished.","message_level":3,"sourceIdentifier":1,"sourceURL":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-strategies.prod.js"}

Could it have to do with the basic auth?

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