Exception using dynamic module in wildcard route (**)
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior If I try to load a dynamic Module as wildcard, I get a null pointer exception:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
@NgModule({
imports: [
BrowserModule,
RouterModule.forRoot([
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'login', loadChildren: 'app/login/login.module#LoginModule' },
{ path: 'not-found', loadChildren: 'app/not-found/not-found.module#NotFoundModule' },
{ path: '**', redirectTo: 'not-found', pathMatch: 'full' }
])
],
declarations: [
AppComponent
],
bootstrap: [AppComponent]
})
export class AppModule { }
This is the error I get:
handleError — core.umd.js:3370EXCEPTION: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'route._loadedConfig.routes')
Minimal reproduction of the problem with instructions Here you can find a ready project
- Angular version: 2.0.1
- Browser: [all]
- Language: [all]
- Node (for AoT issues):
node --version
= 6.6
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to set router wildcard exceptions in an Angular 9 app?
You can set exceptions to the wild-card route by adding the components which needed to be excluded or excepted above the wild-card route...
Read more >Dynamic argument replacement (wildcard) | Drupal.org
When calling comment_reply , the 2 in the arguments array will be replaced by node_load(arg(2)) . The function name is the name of...
Read more >Router tutorial: tour of heroes - Angular
A wildcard route can navigate to a custom "404 Not Found" component or redirect to an existing route. The router selects the route...
Read more >Dynamic imports solve all the problems, right? - Minko Gechev
We specify the path as a string literal but we use a wildcard import. In this scenario, in the general case the bundler...
Read more >ASP.NET Core Blazor routing and navigation - Microsoft Learn
For the URL /catch-all/this/is/a/test with a route template of /catch-all/{*pageRoute} , the value of PageRoute is set to this/is/a/test .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am still unable to lazyload wildcard “**” routes in Angular 4.x, is this fixed somewhere?
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.