Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 13 Prerender error could not find main bundle

I'm trying to pre-render my Angular 13 application. The command which I'm running is:

ng run ipe:prerender --routes-file ./data/routes.txt

The error that occurring is:

    An unhandled exception occurred: Could not find the main bundle: /Users/username/projects/ipe/dist/ipe/server/main.js
    See "/private/var/folders/wh/nz9_hkk52hxc87vcv53tmhj40000gn/T/ng-ygeQrx/angular-errors.log" for further details.

The individual build and server builds in the architect run fine without error.

ng run ipe:build
ng run ipe:server

The code can be found here.

https://github.com/ng-druid/ipe

like image 501
RTC Avatar asked Apr 27 '26 19:04

RTC


1 Answers

I believe I might have found an answer to this. When I clear the cache in angular cli the problem goes away. I think this might have something to do with the cache thinking the server build is available but it is not since each time the build runs it is erased.

rm -rf .angular/cache

Also I'm not having this problem at all on my other project. I copied the boilerplate to this one and it doesn't work the same. There must be something in the configuration I'm missing that is slightly different between the two.

like image 125
RTC Avatar answered Apr 29 '26 09:04

RTC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!