Closed marcoLuo closed 5 years ago
I try to reproduce this issue according your package.json
but failed. Everything works good for me.
try to remove all node_modules
and run yarn cache clean
reinstall again.
I think there is some problems with node_modules/base-x
, check out its version which in my test project is 3.0.5
(both in node_modules/base-x/package.json
and yarn.lock
) and it works well with react-native and eosjs-rn.
eosjsTest.zip it's my react-native project, can you give me a hand? @JadeTao
check out its version which in my test project my base-x verion is also 3.0.5
eosjsTest.zip it's my react-native project, can you give me a hand? @JadeTao
hey, this projects uses eosjs
. I can run it smoothly after I switch to eosjs-rn
instead.
. i can run it smoothly on IOS, but failed on Andriod
still ok with Android Simulator Google Nexus 5X -6.0.0- API 23
with eosjs-rn
can you speak chinese? use wechat? haha~ @JadeTao
you can send me ur wechat via email
you can send me ur wechat via email
ok, thanks
you can send me ur wechat via email
i have sent email to you but not respond, did you received the email?
no...and I test my google mail. it works.
I have figured out this problem.
It is because base-x v3.0.5
use Uint8Array#fill
method, which is not supported in JavaScriptCore
(the react native javascript engine).
And the temporary solution is:
"base-x": "3.0.4"
to your package.json
.npm ls base-x
. make sure there is no base-x@3.0.5
.
btw. base-x
is planning to revert to es5.related issue: https://github.com/uport-project/react-native-uport-connect/issues/10 https://github.com/cryptocoinjs/base-x/issues/51
——
update:
i'm confused too.
i can use Uint8Array
in my own project but can't in this test project.
i don't know why.
core-js helps out. just import 'core-js' in the 1st line of index.js.
core-js helps out. just import 'core-js' in the 1st line of index.js.
it also helps me out. tks
react-native version 0.57.8 package.json content { "name": "eosjsTest", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.6.3", "react-native": "0.57.8", "eosjs-rn": "^20.0.0-beta3" }, "devDependencies": { "babel-jest": "23.6.0", "jest": "23.6.0", "metro-react-native-babel-preset": "0.51.1", "react-test-renderer": "16.6.3" }, "jest": { "preset": "react-native" } }
Version of EOSJS 20.0.0-beta3
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
import { Api, JsonRpc, RpcError } from 'eosjs-rn'; import JsSignatureProvider from 'eosjs-rn/dist/eosjs-jssig'; import { TextEncoder, TextDecoder } from 'text-encoding';
const defaultPrivateKey = "5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr"; const signatureProvider = new JsSignatureProvider([defaultPrivateKey]); const rpc = new JsonRpc('http://127.0.0.1:8888', { fetch }); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() }); (async () => { const result = await api.transact({ actions: [{ account: 'eosio.token', name: 'transfer', authorization: [{ actor: 'useraaaaaaaa', permission: 'active', }], data: { from: 'useraaaaaaaa', to: 'useraaaaaaab', quantity: '0.0001 SYS', memo: '', }, }] }, { blocksBehind: 3, expireSeconds: 30, }); console.dir(result); })();
Expected behavior can not run correctly
Screenshots