Skip to content

[zone.js] Node > 16.17.1: Method Promise.prototype.then called on incompatible receiver #47872

@fmalcher

Description

@fmalcher

Prerendering throws an error when used with a Node version > 16.17.1

🐞 Bug report

What modules are related to this issue?

  • builders
  • common
  • express-engine

Is this a regression?

Yes, the previous version in which this bug was not present was: 14.x

🔬 Minimal Reproduction

Create a new v15 CLI workspace, add SSR and run prerendering:

npx -p @angular/cli@next ng new testproject --routing --style=css
cd testproject
npm run ng -- add @nguniversal/express-engine@next
npm run ng -- run testproject:prerender

🔥 Exception or Error

Warning directly after the start:

TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration. For more information, see https://github.com/browserslist/browserslist

Error at prerendering:

✖ Prerendering routes to testproject/browser failed.
Method Promise.prototype.then called on incompatible receiver [object Object]

This happens with Node v16.18.0 🔥 and v18.11.0 🔥. The error does not appear with Node v16.17.0 ✅ .

🌍 Your Environment


Angular CLI: 15.0.0-rc.0
Node: 18.11.0
Package Manager: npm 8.15.1
OS: darwin arm64

Angular: 15.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.0-rc.0
@angular-devkit/build-angular   15.0.0-rc.0
@angular-devkit/core            15.0.0-rc.0
@angular-devkit/schematics      15.0.0-rc.0
@nguniversal/builders           15.0.0-next.0
@nguniversal/express-engine     15.0.0-next.0
@schematics/angular             15.0.0-rc.0
rxjs                            7.5.7
typescript                      4.8.4

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: zonesIssues related to zone.js

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions