I have a command that generates prerender build in my angular 13 project :
"prerender:staging": "ng run app:prerender --configuration staging",
This is what my angular.json looks like :
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"guessRoutes": false,
"routes": [
"/"
]
},
"configurations": {
"staging": {
"browserTarget": "app:build:staging",
"serverTarget": "app:server:staging"
},
},
"defaultConfiguration": "staging"
},
When I execute the command with "outputHashing": "none" in staging configuration, everything works fine.
However, changing
"outputHashing": "none"
to "outputHashing": "all"
results in an error at the end of the prerender build :
An unhandled exception occurred: Could not find the main bundle: C:\Users\andri\OneDrive\Desktop\test\TEST-Project\app\dist\app\server\main.js
See "C:\Users\user\AppData\Local\Temp\ng-HwSKT5\angular-errors.log" for further details.
What steps should be taken to build Angular prerender with outputHashing="all" ? This is crucial as it clears the cache after each new deployment to the server.