angularserver-side-renderingpre-rendering

Angular 17 window not defined


Recently after updating my angular cli from 16 to 17 I have been facing performance issues and I had no idea what is SSR and prerendering so I left them enabled. But the root cause was ssr.


Solution

  • I disabled SSR in my angular.json

    "server": "src/main.server.ts",
                "prerender": true,
                "ssr": {
                  "entry": "server.ts"
                }
    

    to

    "server": "src/main.server.ts",
                  "prerender": false,
                  "ssr": false