What happened?
After setting vueRouterMode: 'history' in quasar.config, the SPA runs correctly in history mode. However, in Android Capacitor mode, the URL still falls back to hash mode.
While debugging with the Android WebView plugin in VS Code, I found that process.env.VUE_ROUTER_MODE is not set to history in Capacitor mode. As a result, the router defaults to createWebHashHistory in the defineRouter function inside router/index.ts.
What did you expect to happen?
process.env.VUE_ROUTER_MODE should be set to history as configured in quasar.config, so that the router uses history mode in Capacitor as well.
Reproduction URL
Note: The issue only occurs in Capacitor mode.
How to reproduce?
- Set
vueRouterMode: 'history' in quasar.config.
- Run the app in Capacitor mode.
- Use the remote debugger.
- Observe that
process.env.VUE_ROUTER_MODE is set to hash instead of history.
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Capacitor Mode
Platforms/Browsers
Android
Quasar info output
Relevant log output
Additional context
No response