Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic 4 - Url Navigation broken when running via cordova (browser)

$
0
0

@goost wrote:

Hey Guys,

I am building the Angular Router Tutorial Application using Ionic 4 in preparation of a real world project build in Ionic 4.
So far I could find workarounds for every problem I encountered, but now I am stuck:
The latest part of the tutorial was adding a dialog, which asks the user, if she really wanna leave.
As I deploy the app to mobile devices too, naturally I wanted to use @ionic-native/dialogs for that.
First problem, after the manual version selection of the newest beta: ionic serve does not work anymore, as Dialogs cannot find cordova.

This is fine, I add the browser platform to cordova and instead of ionic serve I use ionic cordova emulate browser or ionic cordova run browser. As expected, the dialogs are now working, but something strange happened: The URL navigation broke!

As Ionic 4 now uses the angular router, one navigates the app via URL changes. This is create for e.g. sharing an URL and one can directly type an URL into the address bar and navigate to it. This worked fine with ionic serve, I could directly navigate into a sub-url. Using ionic cordova run browser shows an 404 error if using a sub-url directly (and the error page is generic, not the one defined in the app). Accessing the app only works via the root-route.

Another strange think is that when I navigate the app, the url changes accordingly, but doing a F5 refresh yields again the generic 404 error page. Please look at the gifs for a visual representation.

Does anyone have an idea how to fix this?

IONIC SERVE
ionic_serve
IONIC CORDOVA RUN BROWSER
ionic_cordova

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>