You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: [4.3.0] this.router.getCurrentNavigation is not a function #18082
Ok, I've managed to make everything work with the latest updates.
I suppose that updating Angular through it's own tool solved my problem.
ng update @angular/cli
ng update
ng update @angular/core
And then I forced npm to find all latest packages and ignore specific versions I had in my package.json (before that I didn't notice there were few packages that didn't update).
npm i -g npm-check-updates
ncu -u
npm install
And in the end a bit scary: npm audit fix
Now this.router.getCurrentNavigation is not a function error with @ionic/[email protected] is gone.
A call to getCurrentNavigation was added in Ionic 4.2.0. @goelectricstations are you able to confirm whether or not updating Angular's tooling resolved the issue? If not, can you provide a code reproduction of this issue?
Sorry for not being clearer, but I was referring to your package.json file. The method in question seems to be a newer method that was added in Angular 7.2.0.
Thanks for letting us know about this issue! As it turns out getCurrentNavigation was added in Angular 7.2. (I thought it had been there since Angular 6, but I guess I was wrong 🤷♂️)
We will be deploying hotfixes to both Ionic 4.2.0 and Ionic 4.3.0. I will post an update here when they have been released.
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.
Activity
mrhyper commentedon Apr 20, 2019
I had same situation after update. I noticed that my App is working on @ionic/[email protected], error occurs after update to 4.1.3 and higher.
mrhyper commentedon Apr 20, 2019
I installed older version of @ionic/angular - it works for me, I can keep working while they fix this.
npm install @ionic/[email protected]So command by command it was something like
.. but I do have all other modules updated and I did
npm audit fix...my
ionic infoshows:Ionic:
ionic (Ionic CLI) : 4.12.0 (C:\Users\Hypermotion\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.2.2
System:
NodeJS : v10.15.0 (C:\Program Files (x86)\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
When I install newer version of @ionic/angular the bug comes back in.
In changelog you can see they did some changes to routing .. I suppose it's somewhere ther
https://github.com/ionic-team/ionic/releases
.. but I'll get back to it later .. I hope it'll be fixed and now I can keep writing.
mrhyper commentedon Apr 21, 2019
Ok, I've managed to make everything work with the latest updates.
I suppose that updating Angular through it's own tool solved my problem.
And then I forced npm to find all latest packages and ignore specific versions I had in my package.json (before that I didn't notice there were few packages that didn't update).
And in the end a bit scary:
npm audit fixNow this.router.getCurrentNavigation is not a function error with @ionic/[email protected] is gone.
My ionic info
liamdebeasi commentedon Apr 22, 2019
Hi there,
A call to
getCurrentNavigationwas added in Ionic 4.2.0. @goelectricstations are you able to confirm whether or not updating Angular's tooling resolved the issue? If not, can you provide a code reproduction of this issue?Thanks!
brunoJSX commentedon Apr 22, 2019
I had the same problem. Then I tried the @mrhyper solution but it did not work correctly.
liamdebeasi commentedon Apr 22, 2019
Hi @TryckBR,
Which version of Angular are you using?
brunoJSX commentedon Apr 22, 2019
After the changes:
https://imgur.com/a/9kdCWEv
liamdebeasi commentedon Apr 22, 2019
Hi there,
Sorry for not being clearer, but I was referring to your
package.jsonfile. The method in question seems to be a newer method that was added in Angular 7.2.0.Thanks!
brunoJSX commentedon Apr 22, 2019
Because it did not work I went back as I was. So my package.json looks like this:
Version 4.1.2 works for me, but 4.2.0 and 4.3.0 is not working.
I'm sorry for my English, I'm Brazilian kkk
liamdebeasi commentedon Apr 23, 2019
Hi everyone,
Thanks for letting us know about this issue! As it turns out
getCurrentNavigationwas added in Angular 7.2. (I thought it had been there since Angular 6, but I guess I was wrong 🤷♂️)We will be deploying hotfixes to both Ionic 4.2.0 and Ionic 4.3.0. I will post an update here when they have been released.
Thanks!
brunoJSX commentedon Apr 23, 2019
Thank you very much @liamdebeasi . I was expecting this a lot :)
liamdebeasi commentedon Apr 23, 2019
Hi everyone,
I have published nightly builds for 4.2 and 4.3.
Install nightly for 4.2:
npm i @ionic/[email protected]Install nightly for 4.3:
npm i @ionic/[email protected]I've done testing on this fix, but it would be great if someone else could test with their use case as well.
Thanks!
brunoJSX commentedon Apr 23, 2019
I'll test it now
brunoJSX commentedon Apr 23, 2019
It worked for me. It was perfect <3. Thank you very much ^^
Note: I only tested version 4.3
liamdebeasi commentedon Apr 26, 2019
Hi everyone,
This issue has been resolved via #18107 and is available now in Ionic
4.2.1and4.3.1.Thanks!
ionitron-bot commentedon May 26, 2019
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.