You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 1.16 and earlier I could use a promise based API and use then and catch. Starting with 1.17 the process just exits.
What did you expect to see?
root@659cea540963:/home/sean/go/src/wasm# node --version
v12.22.5
root@659cea540963:/home/sean/go/src/wasm# go version
go version go1.16.13 linux/amd64
root@659cea540963:/home/sean/go/src/wasm# GOOS=js GOARCH=wasm go build -o wasm.wasm
root@659cea540963:/home/sean/go/src/wasm# node --require=./node_shim.js $(go env GOROOT)/misc/wasm/wasm_exec.js wasm.wasm
Promise Blocking
(node:1259) UnhandledPromiseRejectionWarning: TypeError: Expected an object
at RTCPeerConnection.setRemoteDescription (/home/sean/go/src/wasm/node_modules/wrtc/lib/peerconnection.js:300:26)
at syscall/js.valueCall (/usr/local/go/misc/wasm/wasm_exec.js:399:31)
at syscall_js.valueCall (wasm-function[1306]:0x128df5)
at syscall_js.Value.Call (wasm-function[1291]:0x126e9d)
at main.main (wasm-function[1406]:0x14822d)
at runtime.main (wasm-function[500]:0x75408)
at wasm_pc_f_loop (wasm-function[948]:0xd12e1)
at wasm_export_run (wasm-function[946]:0xd12b4)
at global.Go.run (/usr/local/go/misc/wasm/wasm_exec.js:574:23)
at /usr/local/go/misc/wasm/wasm_exec.js:627:14
(node:1259) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1259) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Promise Unblocked
What did you see instead?
sean@SeanLaptop:~/go/src/wasm$ node --version
v16.13.2
sean@SeanLaptop:~/go/src/wasm$ go version
go version go1.17 linux/amd64
sean@SeanLaptop:~/go/src/wasm$ GOOS=js GOARCH=wasm go build -o wasm.wasm
sean@SeanLaptop:~/go/src/wasm$ node --require=./node_shim.js $(go env GOROOT)/misc/wasm/wasm_exec.js wasm.wasm
Promise Blocking
/home/sean/go/src/wasm/node_modules/wrtc/lib/peerconnection.js:300
var promise = this._pc.setRemoteDescription(description);
^
TypeError: Expected an object
at RTCPeerConnection.setRemoteDescription (/home/sean/go/src/wasm/node_modules/wrtc/lib/peerconnection.js:300:26)
at syscall/js.valueCall (/opt/go/misc/wasm/wasm_exec.js:399:31)
at syscall_js.valueCall (wasm://wasm/007b4f9e:wasm-function[1197]:0x113954)
at syscall_js.Value.Call (wasm://wasm/007b4f9e:wasm-function[1182]:0x111a0c)
at main.main (wasm://wasm/007b4f9e:wasm-function[1293]:0x13216c)
at runtime.main (wasm://wasm/007b4f9e:wasm-function[541]:0x7a30b)
at wasm_pc_f_loop (wasm://wasm/007b4f9e:wasm-function[955]:0xd29d3)
at wasm_export_run (wasm://wasm/007b4f9e:wasm-function[953]:0xd29a6)
at global.Go.run (/opt/go/misc/wasm/wasm_exec.js:570:23)
at /opt/go/misc/wasm/wasm_exec.js:623:14
The text was updated successfully, but these errors were encountered:
Sean-Der
changed the title
syscall/js: Behavior for handling promises changed between 1.16 and 1.17
syscall/js: Behavior for handling rejected promises changed between 1.16 and 1.17
Feb 7, 2022
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. I haven't checked gotip yet.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In 1.16 and earlier I could use a promise based API and use
then
andcatch
. Starting with1.17
the process just exits.What did you expect to see?
What did you see instead?
Code
package.json
node_shim.js
main.go
go.mod
The text was updated successfully, but these errors were encountered: