Ionic-framework: Relative links not working

Created on 23 Jul 2019  路  11Comments  路  Source: ionic-team/ionic-framework

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/Users/giacomocerquone/.nvm/versions/node/v10.3.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.3.0
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 ([email protected])
   Cordova Platforms     : android 8.0.0, ios 5.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 13 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/giacomocerquone/Library/Android/sdk)
   ios-deploy        : 2.0.0
   ios-sim           : 8.0.1
   NodeJS            : v10.3.0 (/Users/giacomocerquone/.nvm/versions/node/v10.3.0/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

For sample and other stuff you can refer to the other issues (actually the maintainers should know what this is about https://github.com/ionic-team/ionic/issues/16534)

This is a long standing issue that relies its roots in this issue https://github.com/ionic-team/ionic/issues/16534 which I inspected deeply at that time.
I was removing the package-lock from my project to reinstall some deps and suddenly the app was demonstrating the exact same problem... I got scary pretty quickly since there is a delivery I've to make.
Anyway I noticed that it was getting the new version of @ionic/angular (my project was using 4.3.0, and after the lock deletion there was 4.6.2), so putting in package.json the precise 4.3.0 version my app returned to wark fully.

Can you check please what's going on? Shouldn't be time consuming: @mhartington @paulstelzer

PS. the guy at the end in the thread reported that he was having this issue with 4.3.1, so maybe that is the problematic version.

triage

Most helpful comment

There were some changes regarding how we interact with Angular's change detection in 4.6.1: https://github.com/ionic-team/ionic/commit/e059fc8. We made a few optimizations that skip change detection that helps us reduce jank during the page transitions.

All 11 comments

Ok, I traced it down replacing every time the exact version I was installing.
My problem come back when using version 4.6.1 (and of course 4.6.2)

The commits I see as potentially problematic are: 1f51ab2, b69fb69, e059fc8

Thanks for the issue. Are you able to provide a code example? I am testing relative links with 4.6.2 and navigation seems to work fine on my end.

Well this should be ok:
https://github.com/johanvdb/ionic-4-router-issue
It's not mine, but of another guy who commented in that thread

Thanks for the follow up. I am seeing the bug, but I am also seeing it on 4.5.0. Is this the same issue or something different?

Yes you're right, it is something different, I'm sorry I mixed up the two but actually the bug I was experiencing yesterday after the 4.6.0 version is different (and it's not properly a bug and has nothing to do with the routing, don't know why but yesterday it didn't show up in console, so I though it was the same).

My problem is this: I'm used to do this in my app

ngOnInit() {
    this.sub = this.route.params.subscribe(params => {
      this.data = this.anotherData[+params['myID']].property;
    });
}

and in template just showing something like:

  <div class="card" *ngFor="let box of data.boxes; let i = index;">
  </div>

I know it's somehow incorrect since being the router param handling async, data might still be undefined when template renders, but don't know why this worked always and with no troubles until 4.6.1.
Not saying it's a bug (as I said didn't notice the console log since I was developing in the devapp and thought was the relative link bug again), but where can I find this change documented with some further explanation?

There were some changes regarding how we interact with Angular's change detection in 4.6.1: https://github.com/ionic-team/ionic/commit/e059fc8. We made a few optimizations that skip change detection that helps us reduce jank during the page transitions.

Thanks a lot, at this point I'd leave this issue open for the other router problem relative to the repo I previously linked!
Thanks again a lot!

Hmm which issue are you referring to? If there's already an issue open we typically try to avoid duplicating issues.

No it's not a duplicated issue, I'm referring to the problem you encountered too in this repo https://github.com/johanvdb/ionic-4-router-issue

@giacomocerquone Looks like the issue you are referring to already has a very similar thread open: https://github.com/ionic-team/ionic/issues/18823

I am going to link the two issues and close this issue in favor of the one I linked to. Thanks!

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danbucholtz picture danbucholtz  路  3Comments

giammaleoni picture giammaleoni  路  3Comments

MrBokeh picture MrBokeh  路  3Comments

alexbainbridge picture alexbainbridge  路  3Comments

masimplo picture masimplo  路  3Comments