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: V4 angular 8: Prod build "page not found" on refresh #19020

Closed
Dercetech opened this issue Aug 7, 2019 · 1 comment

Comments

@Dercetech
Copy link

commented Aug 7, 2019

Bug Report

Ionic version:

[x] 4.x

Current behavior:
I use my app, the URL now reflects my current page. I refresh or load that full url:

  • the dev "ionic serve" works properly
  • the prod and release builds can't start

Expected behavior:

  • if my url contains a route, refreshing or accessing a bookmark shouldn't crash ("not found"), it should rather display the right page/component/route.
  • prod and prod release should both work

Steps to reproduce:

  • use the latest ionic
  • ionic start app-test
  • use the navigation or tabbed template
  • cd app-test
  • ionic build --prod (–release is not necessary)
  • serve/deploy www
  • access root url -> works
  • ensure that the route has been appended (like “/home”)
  • refresh
  • crash

Related code:
See the following snapshot in GitHub:
https://github.com/Dercetech/ionic4-angular813-broken-prod-routing

  • it includes the attempt to eager load a route.
  • the package.json versions are frozen to avoid side effects from ^ and ~

Other information:

  • tested with the same node/npm/ionic/cli on a W10 and an OSX Mojave, behavior is unchanged

Ionic info:
Ionic:

Ionic CLI : 5.2.3 (C:\Users\jem\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.7.1
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Utility:

cordova-res : 0.6.0
native-run : 0.2.8

System:

NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10

@ionitron-bot ionitron-bot bot added the triage label Aug 7, 2019

@Dercetech Dercetech closed this Aug 7, 2019

@Dercetech

This comment has been minimized.

Copy link
Author

commented Aug 7, 2019

Sorry, my mistake - I forgot the rewrite rule:

Configure as a single-page app (rewrite all urls to /index.html)?" Enter "Yes".

https://ionicframework.com/docs/publishing/progressive-web-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.