Skip to content

Calling sleep() causes TypeError: can't convert null to BigInt #134

Open
@ShonFrazier

Description

@ShonFrazier

Title says it. Code:

import Foundation
import JavaScriptKit

print("Before sleep()")
sleep(1000) // wasm bails out
print("After sleep()") // Never happens

Project for the above code: https://github.com/ShonFrazier/swiftwasmsleep

The full error is:

 TypeError: can't convert null to BigInt
     poll_oneoff webpack:///./node_modules/@wasmer/wasi/lib/index.esm.js?:128
     start webpack:///./node_modules/@wasmer/wasi/lib/index.esm.js?:131
     startWasiTask webpack:///./entrypoint/dev.js?:92
     async* webpack:///./entrypoint/dev.js?:103
     js http://127.0.0.1:8181/dev.js:97
     __webpack_require__ http://127.0.0.1:8181/dev.js:20
     <anonymous> http://127.0.0.1:8181/dev.js:84
     <anonymous> http://127.0.0.1:8181/dev.js:87
 dev.js:96:11
     handleError webpack:///./entrypoint/dev.js?:96
     (Async: promise callback)
     <anonymous> webpack:///./entrypoint/dev.js?:103
     js http://127.0.0.1:8181/dev.js:97
     __webpack_require__ http://127.0.0.1:8181/dev.js:20
     <anonymous> http://127.0.0.1:8181/dev.js:84
     <anonymous> http://127.0.0.1:8181/dev.js:87

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions