Repository navigation
Closed
Labels
angular/build:applicationarea: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
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
Metadata
Metadata
Assignees
Labels
angular/build:applicationarea: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Activity
JeanMeche commentedon Oct 11, 2023
You can already enable
namedChunkto have a first idea of which chunk is throwing the error.zip-fa commentedon Oct 11, 2023
Yeah, that helped me.
ng-apexchartsis usingwindowglobal sadly :(alan-agius4 commentedon Oct 12, 2023
We should resolve and load sourcemaps when enabled to provide a better stacktrace.
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
fix(@angular-devkit/build-angular): resolve and load sourcemaps durin…
angular-automatic-lock-bot commentedon Nov 16, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.