analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.62k stars 252 forks source link

[BUG] Node > 16.17.1: Method Promise.prototype.then called on incompatible receiver #203

Closed mwienk closed 1 year ago

mwienk commented 1 year ago

Please provide the environment you discovered this bug in.

node: v16.18.0 and higher

Which area/package is the issue in?

astro-angular

Description

I'm receiving an error when I start the sample from https://analogjs.org/docs/packages/astro-angular/overview. At the moment I connect angular into the astro application, it crashes upon requesting the page through the browser.

It might be related to https://github.com/angular/angular/issues/47872, but as the fix there is implemented through @nguniversal/builders I doubt it will fix the issue for @analogjs/astro-angular.

Please provide the exception or error you saw

error   Method Promise.prototype.then called on incompatible receiver [object Object]
TypeError: Method Promise.prototype.then called on incompatible receiver [object Object]
    at ZoneAwarePromise.then (<anonymous>)
    at node:internal/per_context/primordials:440:35
    at new Promise (<anonymous>)
    at new SafePromise (node:internal/per_context/primordials:408:29)
    at node:internal/per_context/primordials:440:9
    at Array.map (<anonymous>)
    at arrayToSafePromiseIterable (node:internal/per_context/primordials:437:5)
    at node:internal/per_context/primordials:453:21
    at new Promise (<anonymous>)
    at primordials.SafePromiseAll (node:internal/per_context/primordials:452:3)

Other information

No response

I would be willing to submit a PR to fix this issue

brandonroberts commented 1 year ago

Thanks @mwienk. I've seen this issue also and still investigating a proper fix/workaround

brandonroberts commented 1 year ago

I've had success with node versions 16.17.x and18.13.0

JeanMeche commented 1 year ago

FYI a PR has landed for this : angular/angular#49144

brandonroberts commented 1 year ago

@JeanMeche awesome. Thanks for the update

brandonroberts commented 1 year ago

This issue has been resolve with at least Node v18.13.0 and the fixes landed in Angular v15/16