Skip to content

zone.js causes issues when using older browsers #50949

@kbutlin-Intouch

Description

@kbutlin-Intouch

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

Yes

Description

We recently updated the version for our Angular project from version 13 to version 16 and a number of customers are reporting issues with our website displaying a completely blank white screen. These customers seem to be using older browsers, with most of them reporting issues on their smart TVs, some of which haven't been updated in a while. We're fairly confident that updating their browsers or switching from the TV's current browser to a more popular one such as Chrome or Firefox would probably resolve the issue, but we would like to reduce the effort on their end where possible, especially since some of them are not sure how to go about updating their TVs and others say they are unable to.

We were able to replicate the issue locally by installing and running our software in an old version of Chromium from 2019 (Version 75.0.3770.0), and our investigation found that it was failing because of some code in node_modules\zone.js\fesm2015\zone.js. More specifically, the line let C = this.constructor?.[Symbol.species]; was throwing up an error stating Uncaught SyntaxError: Unexpected token . was the issue.

We were able to get around this locally by changing lines 1432 and 1451 from this:

let C = this.constructor?.[Symbol.species];

to this:

let myConstructor = this.constructor;
let C;
if(myConstructor)
{
	C = this.constructor[Symbol.species];
}

While this allowed it to compile on our end, none of us are particularly knowledgeable about zone.js, and we're hesitant to make changes to external code which may have a knock-on effect throughout our application. As I understand it, zone.js 0.11.1 introduced a number of breaking changes for old browsers, but is this issue an expected one? We would ideally like to support older browsers where possible and know whether this is likely to be problematic before we make a decision on whether to proceed with it.

I'm not sure if it's a relevant factor, but our application is hosted in Azure.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 16.1.3
Node: 18.16.1
Package Manager: npm 9.5.1
OS: win32 x64

Angular: 16.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1601.3
@angular-devkit/build-angular   16.1.3
@angular-devkit/core            16.1.3
@angular-devkit/schematics      16.1.3
@angular/http                   7.2.16
@schematics/angular             16.1.3
rxjs                            6.6.7
typescript                      4.9.5

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions