Angular prerender build with outputhashing all don't work

Viewed 79

I am running a command which builds prerender build on my angular 13 project :

"prerender:staging": "ng run app:prerender --configuration staging",

This is my angular.json :

    "prerender": {
      "builder": "@nguniversal/builders:prerender",
      "options": {
        "guessRoutes": false,
        "routes": [
          "/"
        ]
      },
      "configurations": {
        "staging": {
          "browserTarget": "app:build:staging",
          "serverTarget": "app:server:staging"
        },
      },
      "defaultConfiguration": "staging"
    },

When building this command while staging configuration "outputHashing": "none" - it is all good and working .

When i change "outputHashing": "none" to "outputHashing": "all" I get this 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.

How to build Angular prerender with outputHashing="all" ? It's important because it eliminates cache after each new build deployed to the server.

0 Answers
Related