ceifa / wasmoon

A real lua 5.4 VM with JS bindings made with webassembly
MIT License
449 stars 29 forks source link

Await doesn't work in Angular project #90

Closed rkristof closed 8 months ago

rkristof commented 10 months ago

I tried using await and promises in an Angular 16 project, but it always fails with the following error:

Error: [string "..."]:3: attempt to call a nil value (method 'await')

I executed the same Lua code using vanilla JS and Vue, and it worked in both cases.

I created a minimal reproduction where you can check it: link

rkristof commented 9 months ago

I did some testing and realized that the reason why it's not working in Angular is because of Zone.js. I'm guessing the difference is in the inner workings of the ZoneAwarePromise object. When I disabled NgZone for the project, the promises started to work.

ceifa commented 8 months ago

Fixed on 1.15.1