'CapacitorJS not serving root index.html for angular application
I'm using CapacitorJS to turn my Angular web application into a mobile app. However, I have an issue.
These are the devices I've tested this on:
Pixel 4a emulator (Android 11),
iPhone XR (iOS 15),
Xiaomi Redmi Note 8 (Android 11)
Version(s):
@angular/core, router 13.0.2
@capacitor/core, android, ios 2.4.0
Repro:
- I open my app
- Javascript files are taken from /
- I click a button to navigate to /example
- Javascript files are still taken from /
- I set the phone to sleep mode and wait (until js file need to be loaded again on app launch)
- I unlock the phone again
- Javascript files are taken from /example
Expected behavior:
Application javascript is taken from /
Actual behavior:
Application javascript is taken from /example (where it does not exist because /example is an Angular route)
Has anyone else experienced this issue, or have a solution for this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
