Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Route not working in v9, but works fine in v9, if Ivy disabled. #36223
Is this a regression?
Yes, the previous version in which this bug was not present was: 8.2.5
I am having problem with loading component, when app starts. It is not lazy loaded(as you can see it from app route file), updated from v8 to v9 went ok. It works great at v8, but after updating to v9 and enabling ivy to true, routing is not working. If ivy is set to false, it works again, even in v9! That's weird.
Basically, when user enters ''.com, it redirects to /questions or user enters /questions.com, it is working fine when ivy is set false.
Issue is already posted on stackoverflow:
Sorry to hear you're having trouble with one of your routes! Unfortunately without an example reproduction that we can run and debug, we won't be able to get very far in diagnosing this issue. The files you post on stackoverflow don't really allow us to reproduce this issue - so if you could provide a Github repo or Stackblitz with instructions on how to observe the problem, we can definitely get to the bottom of it for you.
I found the problem. I went through questions component step by step commenting every single line. The problem was when providing AuthService in one of the questions child component! It seems that AuthService provided in constructor was not "there yet" aka not initialised.
So the solution was in AuthService instead of just using decorator @Injectable, I am now providing this service in root of the app, as it should be:
Thank you Angular team, keep doing great work!