TypeError: Cannot read property 'JsonRpc' of undefined
Version of EOSJS beta
Describe the bug
giving issue while I am providing process.env.REACT_APP_EOSIO_HTTP_URL valid end point
TypeError: Cannot read property 'JsonRpc' of undefined
new EOSIOClient
src/utils/eosio-client.js:8
5 | console.log("^^^^^^^^^^^^^^^^^")
6 | console.log(process.env.REACT_APP_EOSIO_HTTP_URL)
7 | console.log("^^^^^^^^^^^^^^^^^")
> 8 | const rpc = new eosjs.Rpc.JsonRpc(process.env.REACT_APP_EOSIO_HTTP_URL)
9 | const signatureProvider = new eosjs.SignatureProvider([process.env.REACT_APP_EOSIO_PRIVATE_KEY])
10 | this.contractAccount = contractAccount
11 | this.eos = new eosjs.Api({ rpc, signatureProvider })
use import {Rpc, SignatureProvider, Api} from 'eosjs'
and const rpc = new Rpc.JsonRpc( ... const sp = new SignatureProvider( ... const api = new Api( ...
Still not working I changed to what u suggsted
That too while in import statement it showing thi warning
[ts]
Could not find a declaration file for module 'eosjs'.
need to see import eosjs code section
Thank you I solved the issue, i un knowningly changed that [language] to typescript, with this effect every node module not imported after resetting worked fine .
After changing from typescript to babel woking fine
