#[vite] Internal server error: NG0908: In this configuration Angular requires Zone.js

3 messages · Page 1 of 1 (latest)

bright bane
#

When migrating to application builder (used cli to migrate) I get an error once I open it in a browser

09:46:26 [vite] Internal server error: NG0908: In this configuration Angular requires Zone.js
      at _NgZone (c:/Users/me/projects/myproject/node_modules/@angular/core/fesm2022/core.mjs:14618:19)
      at getNgZone (c:/Users/me/projects/myproject/node_modules/@angular/core/fesm2022/core.mjs:14928:16)
      at _PlatformRef.bootstrapModuleFactory (c:/Users/me/projects/myproject/node_modules/@angular/core/fesm2022/core.mjs:32475:24)
      at eval (c:/Users/me/projects/myproject/node_modules/@angular/core/fesm2022/core.mjs:32536:41)

If I use browser-esbuild alone it works

bright bane
#

Seems like ssr is the issue, after removing it it works. I only removed this form angular.json

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

zone.js was missing under polyfills (even though it was imported in polyfills.ts)

"polyfills": [
  "zone.js",
  "src/polyfills.ts"
],