-
Notifications
You must be signed in to change notification settings - Fork 12k
V1.7.0 Nested routing not working #9651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here, our application was working in 1.6.8 yesterday and now in 1.7.0 we got
|
+1 This worked in 1.7.0-rc.0, but stops working in (and after) 1.7.0 (Kleene). To clarify, in my main bundle I'm trying to navigate to a lazy loaded bundle with its own routing. Full stack trace:
Versions:
|
I am having the exact same problem. From my debugging I found that it is because of For now it might be best for us to roll back to the previous version of the angular cli. |
I can also confirm that |
Same in our case. Downgrading to 1.6.8 with flag -vc works |
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
I think we are experiencing the same problem I get the same stack trace. |
Here is the "minimal" repro: I included instructions in the Readme.md |
I've tried to reproduce it, without success. But @KellyR-STCU example made me realize that the problem is location of feature module. When feature module is in fails
works
I have multiple apps, and so I moved some feature modules into libs(nx monorepo style) that are not in |
For the record, I'm facing the same issue reported here with lazy loaded modules. |
The same happens to us. We use sibbling modules: app and other imported modules at the same level:
Navigating from app to otherModule breaks on 1.7.0 and 1.7.1. Workaround to move otherModule into map is not possible in all projects. |
Latest CLI v. 1.7.1 - got the same problem with lazy module loading. Modules are placed in app folder.
UPD: my bad, forgot to remove imports of lazy-loading modules from AppModule. Now it works correctly. |
I had to downgrade to 1.6.8 as well to solve the issue |
same here |
Same here |
same here |
I realized I forgot to remove the lazily loaded module from the imports of my AppModule. I removed that and upgraded to the latest beta (6.0.0-beta.5) and it seems to be fine now for me. |
same error. rolled back to |
@macjohnny this is actually the original as this thread has an earlier date. |
same for me, moved from 1.7.3 to 1.6.8 and now it works. |
Had this same issue. I fixed it by making a few changes to my Routes file.
Updated:
|
Same issue here with CLI 1.7.2. As it has been mentioned in #9775 compiling with --aot seems to fix the problem which is acceptable workaround in my case until its fixed. Really would like to avoid downgrading 😉 |
I upgraded to 1.7.4, and that version is working. I also used --aot, same as Tobias. |
Upgrading to 1.7.4 worked for me; we're also using |
Downgrading to 1.6.8 worked for me as well! |
This doesn't work without --aot. See angular/angular-cli#9651
1.7.4 also works with the --aot flag but not without. |
I experience the same error with AOT works fixed: see this comment module import order matters! |
Same here, work with AOT |
Had the same issue. Fixed it by removing my lazy loaded modules from AppModule since they are, you know, lazy loaded 😄 |
I have same issue. My lazy loaded modules are under Anyone know how to fix? |
@GuerrillaCoder The workaround with AOT explained above works for everyone. Did you try it ? |
Ahh sorry I missed it, yes that works. |
Same issue here with angular/cli: 1.7.3, work with aot |
@bluecaret thank you. why the error just only warning that I import lazy module at app.module.ts is wrong? |
I'm still getting that same error sadly, did try with
I'm clicking on a link to my child route while operating from the parent route when the error is thrown. |
uninstall global and local cli, and reinstall and check that they are identical, check package-lock.json, check that you have the good typescript version. I had a problem a while back and resolve it like this. |
I would recommended to go for a specific version of cli with other third
party plugins which supports same version, for me 1.6.8 worked perfectly.
…On Tue, 28 Aug 2018, 2:59 am k80oshea, ***@***.***> wrote:
I'm still getting that same error sadly, did try with ng serve --aot as
well. I've messed around with it so many time that I'm losing hope - most
solid error is that it can't reach my child routes (although occasionally
it will give me the undefined error instead).
Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'parent/child'
Error: Cannot match any routes. URL Segment: 'parent/child'
I'm clicking on a link to my child route while operating from the parent
route when the error is thrown.
I'm on Angular 5.2 and CLI 1.7.4 - did try downgrading to 1.6.8 but met
with same results.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9651 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATvlkgB7xdtcWHnbENy6GQ7ozaRjG_Bvks5uVGSngaJpZM4SIQJT>
.
|
@jfborie @ashitosh31 thanks - it didn't seem to work right off the bat, but I think it helped after I restructured some more after following this example from the angular docs for my routing |
For anyone else with quite old angular code (eg. v2 or 3 or 4) it is possible that you might be importing global services that you have written in your app.component.ts (in the providers array) as this was an old-style way you could import them. So if you have a providers array in your app.component.ts then delete it and the import statements and instead place them in app.module.ts. This fixed this exact error for me. |
Closing as CLI 1.x is no longer actively maintained. Please update to the latest support version (currently 6.2.4). If the observed problems still exist after updating, please open an new issue detailing the version and environment information. Thank you. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I updated latest @angular/[email protected] and now nested routing not work.I created two routing file like app-routing.module.ts and report-route.module.ts.
report-route.module.ts used in app-routing.module.ts.after updating to latest Angular CLI not working. and its working in V1.6.8
Error is Uncaught (in promise) TypeError: undefined is not a function
The text was updated successfully, but these errors were encountered: