Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

aries-js-worker: broken for Node.js #1237

Open
llorllale opened this issue Feb 11, 2020 · 2 comments
Open

aries-js-worker: broken for Node.js #1237

llorllale opened this issue Feb 11, 2020 · 2 comments
Labels
aries-js-worker bug Something isn't working
Milestone

Comments

@llorllale
Copy link
Contributor

Some parts of the WASM always assume it's running in the browser. For example, the jsindexeddb package is being loaded and this call fails (there is no object named indexedDB in Node).

To reproduce:

npm install @hyperledger/aries-framework-go@0.1.2-snapshot-2f18056
const { Aries } = require("@hyperledger/aries-framework-go")

setTimeout(() => {
    Aries._test._echo("test").then(
        response => console.log(response),
        err => console.error(err)
    )
}, 1000)
Error

$ node App.js panic: syscall/js: call of Value.Call on undefined

goroutine 7 [running]:
syscall/js.Value.Call(0x0, 0x11705a, 0x4, 0x85ab90, 0x2, 0x2, 0xe)
/opt/hostedtoolcache/go/1.13.7/x64/src/syscall/js/js.go:318 +0x7f
github.com/hyperledger/aries-framework-go/pkg/storage/jsindexeddb.openDB(0x1183e6, 0x8, 0x3a972, 0x100cc40, 0xfd508)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/storage/jsindexeddb/jsindexeddb.go:49 +0x6
github.com/hyperledger/aries-framework-go/pkg/storage/jsindexeddb.(*Provider).OpenStore(0x76ece0, 0x1183e6, 0x8, 0x100cc28, 0x773a01, 0x98c640, 0x100cc28)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/storage/jsindexeddb/jsindexeddb.go:39 +0x2
github.com/hyperledger/aries-framework-go/pkg/kms/legacykms.New(0x100cc28, 0x98c640, 0x98c640, 0x100cc28, 0x98c640)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/kms/legacykms/kms.go:40 +0x7
github.com/hyperledger/aries-framework-go/pkg/framework/aries.setAdditionalDefaultOpts.func1(0x1c3240, 0x98c640, 0x1, 0x98c640, 0x0, 0x0)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/framework/aries/default.go:77 +0x3
github.com/hyperledger/aries-framework-go/pkg/framework/aries.createKMS(0x801080, 0x24, 0x8284b0)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/framework/aries/framework.go:330 +0xe
github.com/hyperledger/aries-framework-go/pkg/framework/aries.initializeServices(0x801080, 0x0, 0x0, 0x24)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/framework/aries/framework.go:104 +0x2
github.com/hyperledger/aries-framework-go/pkg/framework/aries.New(0x83ae80, 0x1, 0x1, 0xd2940, 0xc28d760608237e01, 0x853e10)
/home/runner/work/aries-framework-go/aries-framework-go/pkg/framework/aries/framework.go:98 +0x22
main.getAllCommands(0x9987e0, 0x0, 0x0)
/home/runner/work/aries-framework-go/aries-framework-go/cmd/aries-js-worker/main.go:92 +0x7
main.handlers(0x0)
/home/runner/work/aries-framework-go/aries-framework-go/cmd/aries-js-worker/main.go:53 +0x4
main.pipe(0x82a3c0, 0x82a420)
/home/runner/work/aries-framework-go/aries-framework-go/cmd/aries-js-worker/main.go:138 +0x2
created by main.main
/home/runner/work/aries-framework-go/aries-framework-go/cmd/aries-js-worker/main.go:74 +0x4
/home/llorllale/dev/node/test/App.js:4
Aries._test._echo("test").then(
^

TypeError: Cannot read property '_echo' of undefined
at Timeout._onTimeout (/home/llorllale/dev/node/test/App.js:4:17)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)

@llorllale llorllale added the bug Something isn't working label Feb 11, 2020
@troyronda troyronda added this to the 0.1.5 milestone Mar 12, 2020
@jceb
Copy link
Contributor

jceb commented Mar 5, 2021

What's the status of this bug? Would be great to get aries-go working in Node!

@vongohren
Copy link

It was added to 0.1.5 mileston which was completed back in the days and is it in any lists now? So it might be investigated?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aries-js-worker bug Something isn't working
Development

No branches or pull requests

4 participants