angular-prerender: Error generating static site when adding lazy loading routes
Error

Steps to reproduce
-
npx @angular/cli new ng-static --routing -
ng generate universal --client-project ng-static -
Create lazy route

-
ng build
-
ng run ng-static:server
-
npx angular-prerender
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (10 by maintainers)
Hi @mbaljeetsingh, I think I was wrong. Thanks to the help of @kroeder and the friendly people in the Angular.de Slack I’m pretty sure now that running a locally installed command only works on OS X. On Windows it either has to be installed globally or it should be used with npx.
I updated the README to reflect that.
Many thanks again for making me aware of this and please let me know if you run into any further issues.
Hi @mbaljeetsingh, I think I fixed the problem now. Using npx without any arguments like this
npx angular-prerendershould work again.Many thanks for making me aware of that bug. Please let me know if you notice any other issues.
As a side note, I have deployed the site to netlify with the following build command
ng build && ng run ng-static:server && npx angular-prerenderIt seems to be working there. It is most probably the issue with windows or my machine.Website Link https://cocky-turing-e48324.netlify.com/lazy
Alright many thanks in advance.
Another thing which works for me is using npx like this:
npx --package @angular/core --package angular-prerender --package rxjs angular-prerender.