Skip to content

Service worker 6.x does not work correctly in Edge and Samsung Internet on Android #20756

Closed

Description

@dmostert

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

App with service worker loads fine the first time in Chrome 56 (And Edge Android, Samsung Internet). If you reload the page, the app fails with:

ERR_FAILED

Uncaught (in promise) DOMException: Failed to execute 'waitUntil' on 'ExtendableEvent': The event handler is already finished. at Driver.handleFetch (http://127.0.0.1:8887/ngsw-worker.js:1941:15) handleFetch @ ngsw-worker.js:1941

Expected behavior

Service worker enabled sites should work correctly on Chrome 56, Edge and Samsung Internet browsers

Minimal reproduction of the problem with instructions

ng new repro --service-worker
ng build --prod
Use Web server for Chrome or related to browse the dist folder.

What is the motivation / use case for changing the behavior?

Service worker should work correctly on all supported browsers.

Environment


Angular CLI: 1.6.0-rc.1
Node: 8.9.1
OS: win32 x64
Angular: 5.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

@angular/cli: 1.6.0-rc.1
@angular-devkit/build-optimizer: 0.0.34
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.38
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0-rc.1
@schematics/angular: 0.1.8
typescript: 2.4.2
webpack: 3.8.1


Browser:
- [x] Chrome (desktop) version 56
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [x] Edge version  ANDROID 
 
For Tooling issues:
- Node version: v8.9.1  
- Platform:  Windows 

Others:

`
`

Activity

  1. mlc-mlapis commented on Dec 3, 2017

    @mlc-mlapis
    Contributor

    @dmostert ... Chrome (desktop) version 56? Who is using it? What about status for 62?

  2. dmostert commented on Dec 3, 2017

    @dmostert
    Author

    Edge browser on Android uses v58 and Samsung Browser on Android uses v56.

  3. mlc-mlapis commented on Dec 3, 2017

    @mlc-mlapis
    Contributor

    @dmostert ... sure but you mentioned that it is also 56 on desktop.

  4. dmostert commented on Dec 3, 2017

    @dmostert
    Author

    Yes - I used 56 on desktop as an easy way to reproduce the problem. Latest version of CHROME desktop and ANDROID works fine.

  5. mlc-mlapis commented on Dec 3, 2017

    @mlc-mlapis
    Contributor

    @dmostert ... and are you sure that it is not a problem with 56 right on the desktop? I think that it was early implementation of service worker on it so it is probably actually not relevant now.

  6. dmostert commented on Dec 3, 2017

    @dmostert
    Author

    @mlc-mlapis it might be, but current versions of Android's Samsung Internet & Edge USE older versions of Chrome and both of these browsers DON'T work...

  7. changed the title [-]Service worker 5.0.x does not work correctly in Chrome 56 (and related browsers)[/-] [+]Service worker 5.0.x does not work correctly in Edge and Samsung Internet on Android[/+] on Dec 4, 2017
  8. self-assigned this
    on Dec 8, 2017
  9. DominicBoettger commented on Dec 13, 2017

    @DominicBoettger

    Did you already investigate in this issue?

  10. muriloamendola commented on Jan 16, 2018

    @muriloamendola

    We are facing the same problem. We have opened another issue about the same problem on #21292.

  11. 48 remaining items

  12. removed their assignment
    on May 25, 2020
  13. gkalpak commented on May 25, 2020

    @gkalpak
    Member

    To recap (for future reference):

    If anyone wants to take it on, the possible fixes are:

    • Make it possible/easy to include extra scripts in the worker script via the cli; e.g. there could be a config option in angular.json to specify an extra script file (similar to polyfills.ts but for ngsw-worker.js).
      Or it could be a list of JS scripts to be imported (using importScripts(...)) at the top of ngsw-worker.js.
      • PROS: Flexible. Only those who need it pay the extra size cost.
      • CONS: Still requires some work from the developer. Not very easy to discover the problem/fix.
    • Embed our own version of the polyfill in the ngsw-worker.js script.
      • PROS: Works automatically.
      • CONS: Everyone pays the extra size cost (even if they don't need the polyfill).
  14. sebaherrera commented on Jul 16, 2020

    @sebaherrera

    Hi. Isn't the service worker regenerated at build time? If so, you might be able to add/remove the polyfill based on browserslist file.

  15. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    and removed on Oct 1, 2020
  16. added
    P4A relatively minor issue that is not relevant to core functions
    and removed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Apr 6, 2021
  17. jelbourn commented on Apr 6, 2021

    @jelbourn
    Contributor

    Closing this since it's been long enough that newer versions of Edge and Samsung Internet are based on Chromium 60+ which shouldn't have the issue any longer

  18. angular-automatic-lock-bot commented on May 7, 2021

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  19. locked and limited conversation to collaborators on May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions