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
After update angular my application shows the loader and that's it, nothing happens.
On version 2.4.7 the site works just fine.
I have no errors on console. I have no clue what's causing this issue except the version change Expected behavior
The site should work just like it 2.4.7
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Updating angular from 2.4.7 to 2.4.8
Please tell us about your environment:
Windows 10,
Webstorm 2016.3.3
Angular version: 2.0.8
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
I am also having the same issue. One of my nested route has a canLoad guard which is returning false initially and my app component is making a api request and based on that response I redirect the user. It was working fine till 2.4.7 but now app.component is not initializing and hence this api request is not going.
There is a service called LoginService, in that make variable isLoggedIn true and code in app.component will initialize else not.
Reacted by Yaroslav Admin, Muhammed Hussain, Volodymyr O., Alexander Turtsevich, Bram Strack van Schijndel, Diego Bonura, Patrick Surrey, Llyle van Schalkwyk, Aleš, Thomas Raffray and 4 more
Not sure if it's related, but after updating to *.4.8, I'm getting errors caused by router events happening before root component's constructor is called (where I set up permission rules for my guards). This definitely was not happening in *.4.7.
Obviously, the module that was lazy loaded before needs to be imported into the AppModule.
The original implementation has been working for a long time, and the app stopped loading only after upgrading to 2.4.8
Edit:
Refreshing the page while the user is in any part of the lazy loaded module - doesn't work now as well.. I.e. if the user navigated to any route that was originally lazy loaded, refreshing the page while still being on that route - the app never loads. Guards seem to have no effect in our case.
The issue is gone after downgrading to @angular/router: 3.4.7
Reacted by James Birtles, Yc. Shen, Burak Tasci, Marius and Max Holmark
@juanmcampos You don't have to wait the next release, just fix your package.json dependencies to 2.4.7 instead of 2.4.8. (except 3.4.7 for @angular/router)
router: do not finish bootstrap until all the routes are resolved (#14608) (2a191ca), closes #12162 #14155
Honestly we all had to fall back at 2.4.7 and it seems that won't be able to upgrade to a higher version of 4.0.0-beta.8 because these changes (2a191ca).
The question is, Angular 4.0 is planned to be backwards compatible, or not? Are there any plans about the changes on 2a191ca will exist, or be subject to opt-in, (or whatever) on further releases than rc.1?
Enlightment appreciated
Reacted by Alexander Turtsevich, Arda Tugay and Marius
Activity
DzmitryShylovich commentedon Feb 19, 2017
Pls add a repro
ritox842 commentedon Feb 19, 2017
A repro of what ? I can't link to the app cause it's a closed project..
DzmitryShylovich commentedon Feb 19, 2017
what do you think we can do with it without the info how to reproduce? http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5?p=preview <- app using 2.4.8 and it works fine
ASHFAQPATWARI commentedon Feb 19, 2017
I am also having the same issue. One of my nested route has a
canLoad guardwhich is returningfalseinitially and my app component is making a api request and based on that response I redirect the user. It was working fine till 2.4.7 but now app.component is not initializing and hence this api request is not going.DzmitryShylovich commentedon Feb 19, 2017
Looks like a bug was introduced in #14327
DzmitryShylovich commentedon Feb 19, 2017
but as I said it's very hard to do something without a small repro.
@ASHFAQPATWARI can you provide a plunkr?
ASHFAQPATWARI commentedon Feb 19, 2017
can you point me to a plunker with route and route guards? Then I will do the necessary changes in it to reproduce this issue.
volodymyro-in6k commentedon Feb 19, 2017
I have the same issue with 2.4.8.
It works only after canLoad or Resolve is turned off.
ASHFAQPATWARI commentedon Feb 19, 2017
Yes, even if I return true in my canLoad, then things are working.
DzmitryShylovich commentedon Feb 19, 2017
@ASHFAQPATWARI http://plnkr.co/edit/JWkl619QHbDiUtgec33t?p=preview
ASHFAQPATWARI commentedon Feb 19, 2017
@DzmitryShylovich here is the repo to reproduce the issue:
http://plnkr.co/edit/RKMEWDN44rf8yoyYP2Ya?p=preview
There is a service called LoginService, in that make variable isLoggedIn true and code in app.component will initialize else not.
fxck commentedon Feb 20, 2017
Not sure if it's related, but after updating to *.4.8, I'm getting errors caused by router events happening before root component's constructor is called (where I set up permission rules for my guards). This definitely was not happening in *.4.7.
kirjai commentedon Feb 20, 2017
I too have stumbled upon this issue.. In our case, the following routing structure was causing the error:
The issue was resolved as soon as I removed lazy loading of the redirect route.
Obviously, the module that was lazy loaded before needs to be imported into the
AppModule.The original implementation has been working for a long time, and the app stopped loading only after upgrading to
2.4.8Edit:
Refreshing the page while the user is in any part of the lazy loaded module - doesn't work now as well.. I.e. if the user navigated to any route that was originally lazy loaded, refreshing the page while still being on that route - the app never loads. Guards seem to have no effect in our case.
The issue is gone after downgrading to
@angular/router: 3.4.728 remaining items
DzmitryShylovich commentedon Feb 24, 2017
@mogusbi the next release
mogusbi commentedon Feb 24, 2017
@DzmitryShylovich OK let me rephrase my question then, when can we expect 2.4.9 with this fix to be released? :)
juanmcampos commentedon Feb 25, 2017
@mogusbi based on https://github.com/angular/angular/blob/master/docs/RELEASE_SCHEDULE.md I think it would be next week :(, i should have never deleted my node_modules and updated the cli
JCornat commentedon Feb 25, 2017
@juanmcampos You don't have to wait the next release, just fix your
package.jsondependencies to2.4.7instead of2.4.8. (except3.4.7for@angular/router)Example :
fulls1z3 commentedon Feb 26, 2017
@DzmitryShylovich, @vsavkin I see that the sam set of changes causing this issue (41dd62c) have been included on 4.0.0-rc.1 (2a191ca):
Honestly we all had to fall back at 2.4.7 and it seems that won't be able to upgrade to a higher version of 4.0.0-beta.8 because these changes (2a191ca).
The question is, Angular 4.0 is planned to be backwards compatible, or not? Are there any plans about the changes on 2a191ca will exist, or be subject to opt-in, (or whatever) on further releases than rc.1?
Enlightment appreciated
DzmitryShylovich commentedon Feb 26, 2017
@fulls1z3 this change is required for universal #14588 (comment)
according to semver major releases may contain incompatible changes
revert: fix(router): do not finish bootstrap until all the routes are…
DzmitryShylovich commentedon Feb 28, 2017
@ritox842 the commit was reverted #14681
so you can close this issue
ritox842 commentedon Feb 28, 2017
Ok
pravashupreti commentedon Dec 20, 2017
This is the best solution 👍
Starting route after APP_Initialize response
@component({})
class App {
constructor(router: Router, loginService: LoginService) {
loginService.initialize();
router.initialNavigation();
}
}
@NgModule({
imports: [
BrowserModule,
RouterModule.forRoot(routes, {initialNavigation: false})
],
declarations: [ App ],
bootstrap: [ App ],
providers: [ Guard, LoginService ]
})
export class AppModule {
}
lock down angular version due to angular/angular#14588
Revert "lock down angular version due to angular/angular#14588"
angular-automatic-lock-bot commentedon Sep 13, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.