Skip to content

[Bug]: 404 https://example.com/OneSignalSDK.sw.js #1404

@ln-e

Description

@ln-e

What happened?

OneSignal occasionally attempts to fetch a service worker from an unexpected URL (e.g. https://example.com/OneSignalSDK.sw.js?appId=...&sdkVersion=...).
This happens when the main worker https://example.com/OneSignalSDKWorker.js fails to install — the SDK falls back to an internal _fallbackToUserModelBetaWorker method, which try to find file on current domain. Since the OneSignal documentation does not mention creating such a file, it’s guaranteed to be missing.
As a result, we end up loading redundant code that never works and only produces repeated errors in the logs.

Steps to Reproduce:

Image

What browsers are you seeing the problem on?

Other

What operating system are you running?

Sonoma

Steps to reproduce?

Simulate a network failure or block OneSignal CDN.

Open the app with OneSignal enabled.

Check the network tab — repeated fetches to a non-existent OneSignalSDK.sw.js endpoint appear.

What did you expect to happen?

No 404 request are made

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions