'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



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RTC