Summary
Under edge --safe, event-loop callbacks do not dispatch. Sync code and microtasks run, but setTimeout, setImmediate, async fs, and similar callbacks are silent.
- Registry package name: callbacks do not dispatch.
- Local WEBc file with identical bytes: callbacks dispatch normally.
Native edge is fine. Same Wasmer, same package, same --experimental-napi flag.
Minimal Repro
wasmer package download wasmer/edgejs@0.0.0-4ad8137 --out-path edge.webc
# registry NAME -> timer never fires
wasmer run --experimental-napi wasmer/edgejs@=0.0.0-4ad8137 -- \
-e "setTimeout(() => process.exit(42), 50)"; echo $? # 0
# same bytes, LOCAL file -> timer fires
wasmer run --experimental-napi ./edge.webc -- \
-e "setTimeout(() => process.exit(42), 50)"; echo $? # 42
Observed
setTimeout(() => process.exit(42), 50) exits 0.
- A two-timer re-arm exits
0.
- Async
fs.readFile exits 0.
setImmediate(() => process.exit(42)) stays alive without dispatching the callback.
edge --safe -e "setTimeout(() => process.exit(42), 50)" exits 0.
The same cases work from ./edge.webc; timer/immediate probes exit 42, and async fs.readFile fires its callback.
Expected
wasmer run <registry-name> should dispatch callbacks the same way wasmer run <local-file> does when both refer to the same --experimental-napi package bytes.
Notes
A setTimeout(cb, 2000) keeps the process alive for roughly 2 seconds, but the callback is not dispatched. So the clock wait appears to return on time; the JS callback just never runs.
- Not the package bytes: the downloaded local WEBc works.
- Not guest network or mounted volumes: the minimal repro above uses neither.
- Not only
edge --safe: direct wasmer run --experimental-napi <registry-name> reproduces it.
Workaround
edge --safe --wasmer-package ./edge.webc dispatches callbacks correctly. A .webc dir or EDGE_WASMER_PACKAGE should follow the same local-package path.
Environment
- Edge.js:
v24.13.2-pre
- Package:
wasmer/edgejs@0.0.0-4ad8137
- Wasmer:
7.1.0 reproduces
- Platform: macOS arm64
- Also reported separately on Linux amd64
Summary
Under
edge --safe, event-loop callbacks do not dispatch. Sync code and microtasks run, butsetTimeout,setImmediate, asyncfs, and similar callbacks are silent.Native
edgeis fine. Same Wasmer, same package, same--experimental-napiflag.Minimal Repro
Observed
setTimeout(() => process.exit(42), 50)exits0.0.fs.readFileexits0.setImmediate(() => process.exit(42))stays alive without dispatching the callback.edge --safe -e "setTimeout(() => process.exit(42), 50)"exits0.The same cases work from
./edge.webc; timer/immediate probes exit42, and asyncfs.readFilefires its callback.Expected
wasmer run <registry-name>should dispatch callbacks the same waywasmer run <local-file>does when both refer to the same--experimental-napipackage bytes.Notes
A
setTimeout(cb, 2000)keeps the process alive for roughly 2 seconds, but the callback is not dispatched. So the clock wait appears to return on time; the JS callback just never runs.edge --safe: directwasmer run --experimental-napi <registry-name>reproduces it.Workaround
edge --safe --wasmer-package ./edge.webcdispatches callbacks correctly. A.webcdir orEDGE_WASMER_PACKAGEshould follow the same local-package path.Environment
v24.13.2-prewasmer/edgejs@0.0.0-4ad81377.1.0reproduces