Hello!
I’m trying to use aepp-sdk-js inside the browser. After many approaches to achieve this, the further I’ve reach was including aepp-sdk.browser.js directly in my html. However, this didn’t work as I’m getting this error:
Uncaught TypeError: Cannot read property ‘resolve’ of undefined
at l (client.js:56)
This is raised when rpc/client.js executes:
parent.postMessage({ jsonrpc: ‘2.0’, id: sequence, method, params, session: this.session }, ‘*’)
but the message handler routine receives an event without data:
function receive ({ data }) {
if (typeof data !== 'object' || data.type === 'webpackOk') {
return
}
const { result: { resolve, reject }, id } = data
and with data being undefined, the error raises.
I need help with this:
I tried and got that error with versions 2.0.0, 2.3.0, and some earlier than those. what should it do?
The error happens in firefox as in chrome, loading the code from file and also served by a webserver.
Finally what I want to achieve is build a simple aepp with a contract in an state channel:
- Which sdk version should I be using?
- Which node version is recommended?
Thanks!!
PS: I’ve got the same problem when using versions: 3.3.0 and 3.2.0, however using 3.1.0, this new problem happens:
Uncaught TypeError: Cannot read property ‘ModeOfOperation’ of undefined
in es/utils/crypto.js:
const Ecb = aesjs.ModeOfOperation.ecb
I’ve switched to source version of the library and making the bundle with them. I’ve got the same problem when crypto.js try to use aes-js. I’ve “solved” it, by commenting “externals” section in webpack.config.js. But, after doing that, a new problem shows up:
“Uncaught (in promise) Error: rpc client: Can’t send messages to itself”
Triggered at rpc/client.js: RpcClient async init function.