Prerender Unable to extract routes from application.
See original GitHub issueWhen I am trying to run “npm run prerender” without lazy-routing it’s working but when I am trying with lazy-routing it’s giving me ERORR Unable to extract routes from application.
Working with
const routes: Routes = [ { path: '', component:HomeComponent } } ];
Not working with this
const routes: Routes = [ { path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule) } ];
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Unable to extract routes from application while pre rendering ...
I'm trying to implement pre rendering in angular app version 11. After running the command npm run prerender I'm getting the below error...
Read more >Angular v9 & Universal: SSR and prerendering out of the box!
The routing modules of your application are analyzed and the routes found are prerendered. To prerender the routes of your application, just run ......
Read more >Prerender Unable to extract routes from application.
When I am trying to run "npm run prerender" without lazy-routing it's working but when I am trying with lazy-routing it's giving me...
Read more >Prerendering static pages - Angular
Angular Universal lets you prerender the pages of your application. ... guessRoutes, Whether builder should extract routes and guess which paths to render....
Read more >Problem running Build command: npm run prerender - Support
... message 2:56:29 PM: Command failed with exit code 1: npm run prerender ... run spotbie:prerender 11:47:01 PM: Unable to extract routes from...
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
@alcfeoh Yep. If you have already run
ng add @nguniversal/express-engine
, it should be located at the bottom ofangular.json
. By default it looks like thisYou can switch out
"routes"
for"routesFile"
and give it the relative path to a file with newline separated routes instead of an array. E.g.I am having an issue that seems similar. Setting the “guessRoutes”: false fixed the initial error but I also get: Prerendering 9 route(s) to C:\development\blog-universal\dist\blog-universal\browser An unhandled exception occurred: spawn ENAMETOOLONG See “C:\Users\jeffm\AppData\Local\Temp\ng-NwusJ7\angular-errors.log” for further details. npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file C:\WINDOWS\system32\cmd.exe npm ERR! errno ENOENT npm ERR! blog-universal@0.0.0 prerender:
ng run blog-universal:prerender
npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the blog-universal@0.0.0 prerender script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\jeffm\AppData\Roaming\npm-cache_logs\2020-10-07T15_57_06_582Z-debug.log. Not finding much information, any help would be appreciated