Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Service worker not registered in Android #11500

Open
izderadicka opened this issue Oct 26, 2024 · 0 comments
Open

[bug] Service worker not registered in Android #11500

izderadicka opened this issue Oct 26, 2024 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@izderadicka
Copy link

Describe the bug

I have Svelte app with custom service worker, it works fine in Linux app, but in Android I'm getting this error:

10-26 19:45:52.643  8304  8304 E Tauri/Console: File: http://tauri.localhost/src/main.ts - Line 24 - Msg: Service worker registration failed with TypeError: Failed to register a ServiceWorker for scope ('http://tauri.localhost/') with script ('http://tauri.localhost/service-worker.js'): An unknown error occurred when fetching the script. TypeError: Failed to register a ServiceWorker for scope ('http://tauri.localhost/') with script ('http://tauri.localhost/service-worker.js'): An unknown error occurred when fetching the script.

I'm suspecting, that problem might be with URL (scope), as service worker is installed only from secure/https scope or from http://localhost (later is kind of exception mainly for development). He it is http://tauri.localhost - I think this may be a problem?

Reproduction

My project is at https://github.com/izderadicka/audioserve-web/tree/tauri - so it's now on branch tauri.

  1. Clone project
  2. Switch to tauri branch
  3. cargo tauri android dev - the device is Android 14 emulated
  4. The problem with registering service worker should appear in terminal listing

Expected behavior

Service worker registration should work - it does in Linux desktop app.

Full tauri info output

$ cargo tauri info

[✔] Environment
    - OS: Ubuntu 22.4.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.3
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.18.0
    - yarn: 1.22.11
    - npm: 10.8.2



[-] Packages
    - tauri 🦀: 2.0.6
    - tauri-build 🦀: 2.0.2
    - wry 🦀: 0.46.3
    - tao 🦀: 0.30.3
    - tauri-cli 🦀: 2.0.3
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.0.3 (outdated, latest: 2.0.4)

[-] Plugins
    - tauri-plugin-log 🦀: 2.0.1
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:5000/
    - framework: Svelte
    - bundler: Rollup

Stack trace

No response

Additional context

No response

@izderadicka izderadicka added status: needs triage This issue needs to triage, applied to new issues type: bug labels Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant