wasmedge-quickjs icon indicating copy to clipboard operation
wasmedge-quickjs copied to clipboard

Javascript setTimeout not working

Open shebbys opened this issue 2 years ago • 5 comments

I'm unable to get setTimeout to work in the example hello.js and react18_ssr, on a mac m1.

The function exists however it never actually times out - it just hangs indefinitely.

shebbys avatar Jun 14 '22 16:06 shebbys

@hydai I think there are some bugs in Mac's poll_oneoff()

L-jasmine avatar Jun 16 '22 03:06 L-jasmine

Hi @shebbys Could you provide a minimum code snippet for reproducing this issue?

hydai avatar Jun 16 '22 03:06 hydai

I will provide a minimum code

L-jasmine avatar Jun 16 '22 03:06 L-jasmine

This is enough to reproduce it

(base) example_js % cat timeout.js import * as os from 'os'; import * as std from 'std'; let timer = setTimeout( ()=>{ print('yep'); }, 2000 ) (base) example_js % wasmedge --dir .:. ../target/wasm32-wasi/release/wasmedge_quickjs.wasm timeout.js

shebbys avatar Jun 16 '22 17:06 shebbys

Can reproduce the hanging on MacOS Catalina.

Tails avatar Sep 25 '22 10:09 Tails