Skip to content

application builder: non-informative exceptions with prerender: true #26013

Closed

Description

@zip-fa

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

Activity

  1. JeanMeche commented on Oct 11, 2023

    @JeanMeche
    Member

    You can already enable namedChunk to have a first idea of which chunk is throwing the error.

  2. zip-fa commented on Oct 11, 2023

    @zip-fa
    Author

    You can already enable namedChunk to have a first idea of which chunk is throwing the error.

    Yeah, that helped me. ng-apexcharts is using window global sadly :(

  3. alan-agius4 commented on Oct 12, 2023

    @alan-agius4
    Collaborator

    We should resolve and load sourcemaps when enabled to provide a better stacktrace.

  4. self-assigned this
    on Oct 12, 2023
  5. added
    freq1: low
    on Oct 12, 2023
  6. added 5 commits that reference this issue on Oct 13, 2023
    48657af
    2768637
    b12a6c8
    50a8415
    b93a9ab
  7. added 2 commits that reference this issue on Oct 16, 2023
    0f45e21
    263271f
  8. angular-automatic-lock-bot commented on Nov 16, 2023

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions