Don't know.
Fails to detect routes from lazy-loaded modules and doesn't generate static routes when routes in routeFile is in specific order.
My main routes are like this:
[
{ path: 'xyz1', loadChildren: import(module1-file).then(m => m.module1) },
{ path: 'xyz2', loadChildren: import(module2-file).then(m => m.module2) },
{ matcher: ... , loadChildren: import(module3-file).then(m => m.module3) },
{ matcher: ... , loadChildren: import(module4-file).then(m => m.module4) },
{ path: '', loadChildren: import(module5-file).then(m => m.module5) }
]
All paths lazily load modules first (with proper import syntax). There are also static routes inside all of the modules like { path: 'xyz', component: ...}. Catch all path ** is inside module5.
First Bug
ng run project-name:prerender fails to detect even one route. I don't expect it to detect from matcher, but it should be able to detect static paths from other modules.
Second Bug
When I provide it routeFile with following routes:
/module5-path1
/module1-path1
/module2-path1
/module5-path2
/module5-path3
...
Only first 3 routes are generated. No error is thrown.
When I change the sequence of routes as follows:
/module5-path1
/module5-path2
/module5-path3
/module1-path1
/module2-path1
...
All routes are generated successfully.
As order shouldn't matter, this is definitely a bug.
Unable to extract routes from application.
An unhandled exception occurred: No routes found.
No error message for the second bug.
Angular CLI: 9.0.0-rc.7
Node: 12.6.0
OS: win32 x64
Angular: 9.0.0-rc.7
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.7
@angular-devkit/build-angular 0.900.0-rc.7
@angular-devkit/build-ng-packagr 0.803.14
@angular-devkit/build-optimizer 0.900.0-rc.7
@angular-devkit/build-webpack 0.900.0-rc.7
@angular-devkit/core 9.0.0-rc.7
@angular-devkit/schematics 9.0.0-rc.7
@angular/cdk 9.0.0-rc.6
@angular/fire 5.2.3
@angular/flex-layout 8.0.0-beta.27
@angular/material 9.0.0-rc.6
@angular/platform-server 9.0.0-rc.8
@angular/service-worker 8.2.12
@ngtools/webpack 9.0.0-rc.7
@nguniversal/builders 9.0.0-rc.0
@nguniversal/common 9.0.0-rc.0
@nguniversal/express-engine 9.0.0-rc.0
@schematics/angular 9.0.0-rc.7
@schematics/update 0.900.0-rc.7
rxjs 6.5.4
typescript 3.6.4
webpack 4.41.2
Hi, would you be able to provide a minimal reproduction? I will go a long way for us to fix this bug faster.
@alan-agius4 Here, you go: https://github.com/SachinShekhar/angular-ssr-prerendering-bug
Check commit messages for more details. For the first bug, matcher is screwing things up. I am unable to reproduce the second bug. I am working on it.
Unable to extract routes from application. is coming from utils.ts which means guess-parser's parseAngularRoutes is throwing.
So not specifying routes or routesFile will result in no routes being found - hence the error Could not find any routes to prerender.
@SachinShekhar I am also unable to reproduce the second bug.
//cc @mgechev
We can close this issue and move the discussion to guess-js/guess.
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._