Closed
Description
Command
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Hi.
I am trying new application
builder with "prerender": true
option enabled, but it gives me an error:
An unhandled exception occurred: window is not defined
See "C:\Users\123\AppData\Local\Temp\ng-AXVmxB\angular-errors.log" for further details.
Content of the error file:
[error] ReferenceError: window is not defined
at file:///C:/chunk-SJA6CGGK.mjs:96:121215
at file:///C:/chunk-7JMVHTMF.mjs:3:1036
at file:///C:/chunk-SJA6CGGK.mjs:696:32603
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
But there is no file at given location. Angular deletes it after failed build?
I don't use raw window
global, instead i am injecting WINDOW token everywhere, so root of the problem is somewhere in vendor. There is literally no way to debug this for now
Minimal Reproduction
ng build
Exception or Error
No response
Your Environment
Angular CLI: 17.0.0-next.8
Node: 18.18.1
Package Manager: npm 9.8.1
OS: win32 x64
Angular: 17.0.0-next.7
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1700.0-next.8
@angular-devkit/build-angular 17.0.0-next.8
@angular-devkit/core 17.0.0-next.8
@angular-devkit/schematics 17.0.0-next.8
@angular/cdk 17.0.0-next.6
@angular/cli 17.0.0-next.8
@angular/material 17.0.0-next.6
@angular/ssr 17.0.0-next.8
@schematics/angular 16.2.5
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.0
Anything else relevant?
No response