Skip to content

App won't start on version 2.4.8 #14588

Closed

Description

@ritox842

I'm submitting a ... (check one with "x")

[x ] bug report 
[ ] feature request
[ ] support request

Current behavior

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 ]

Chrome 56.0.2924.87 (Only one that was tested)

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript 2.1.6

Activity

  1. DzmitryShylovich commented on Feb 19, 2017

    @DzmitryShylovich
    Contributor

    Pls add a repro

  2. ritox842 commented on Feb 19, 2017

    @ritox842
    Author

    A repro of what ? I can't link to the app cause it's a closed project..

  3. DzmitryShylovich commented on Feb 19, 2017

    @DzmitryShylovich
    Contributor

    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

  4. ASHFAQPATWARI commented on Feb 19, 2017

    @ASHFAQPATWARI

    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.

  5. DzmitryShylovich commented on Feb 19, 2017

    @DzmitryShylovich
    Contributor

    Looks like a bug was introduced in #14327

  6. DzmitryShylovich commented on Feb 19, 2017

    @DzmitryShylovich
    Contributor

    but as I said it's very hard to do something without a small repro.
    @ASHFAQPATWARI can you provide a plunkr?

  7. ASHFAQPATWARI commented on Feb 19, 2017

    @ASHFAQPATWARI

    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.

  8. volodymyro-in6k commented on Feb 19, 2017

    @volodymyro-in6k

    I have the same issue with 2.4.8.
    It works only after canLoad or Resolve is turned off.

  9. ASHFAQPATWARI commented on Feb 19, 2017

    @ASHFAQPATWARI

    Yes, even if I return true in my canLoad, then things are working.

  10. DzmitryShylovich commented on Feb 19, 2017

    @DzmitryShylovich
    Contributor
  11. ASHFAQPATWARI commented on Feb 19, 2017

    @ASHFAQPATWARI

    @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.

  12. added
    regressionIndicates than the issue relates to something that worked in a previous version
    on Feb 20, 2017
  13. fxck commented on Feb 20, 2017

    @fxck

    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.

  14. kirjai commented on Feb 20, 2017

    @kirjai
    Contributor

    I too have stumbled upon this issue.. In our case, the following routing structure was causing the error:

    const routes: Routes = [
      path: '',
      canActivate: [SomeGuard],
      children: [
          { path: '', redirect: 'some-route', pathMatch: 'full' },
          { path: 'some-route', loadChildren: '......' },
      ]
    ];
    

    The issue was resolved as soon as I removed lazy loading of the redirect route.

    ...
    { path: 'some-route, component: SomeRouteComponent }
    

    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

  15. 28 remaining items

  16. DzmitryShylovich commented on Feb 24, 2017

    @DzmitryShylovich
    Contributor

    @mogusbi the next release

  17. mogusbi commented on Feb 24, 2017

    @mogusbi

    @DzmitryShylovich OK let me rephrase my question then, when can we expect 2.4.9 with this fix to be released? :)

  18. juanmcampos commented on Feb 25, 2017

    @juanmcampos

    @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

  19. JCornat commented on Feb 25, 2017

    @JCornat

    @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)

    Example :

    "dependencies": {  
      "@angular/common": "2.4.7",  
      "@angular/compiler": "2.4.7",  
      "@angular/core": "2.4.7",  
      "@angular/forms": "2.4.7",  
      "@angular/http": "2.4.7",  
      "@angular/platform-browser": "2.4.7",  
      "@angular/platform-browser-dynamic": "2.4.7",  
      "@angular/platform-server": "2.4.7",  
      "@angular/router": "3.4.7",
      ...
    },
    "devDependencies": {
      "@angular/compiler-cli": "2.4.7",
      ...
    }`
    
  20. fulls1z3 commented on Feb 26, 2017

    @fulls1z3

    @DzmitryShylovich, @vsavkin I see that the sam set of changes causing this issue (41dd62c) have been included on 4.0.0-rc.1 (2a191ca):

    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

  21. DzmitryShylovich commented on Feb 26, 2017

    @DzmitryShylovich
    Contributor

    @fulls1z3 this change is required for universal #14588 (comment)

    The question is, Angular 4.0 is planned to be backwards compatible, or not?

    according to semver major releases may contain incompatible changes

  22. DzmitryShylovich commented on Feb 28, 2017

    @DzmitryShylovich
    Contributor

    @ritox842 the commit was reverted #14681
    so you can close this issue

  23. ritox842 commented on Feb 28, 2017

    @ritox842
    Author

    Ok

  24. pravashupreti commented on Dec 20, 2017

    @pravashupreti

    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 {
    }

  25. angular-automatic-lock-bot commented on Sep 13, 2019

    @angular-automatic-lock-bot

    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.

  26. locked and limited conversation to collaborators on Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerregressionIndicates than the issue relates to something that worked in a previous version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions