-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import the polkadot-api in React-Native, The error summary #481
Comments
This seems to be a babel 7.2 (as used by API) vs 7-beta issue. We really want these to just work without tweaking, so need to investigate. EDIT: After reading quite a bit, between the beta and release, things have changed a bit. The recommended solution is to add core-js as an explicit dependency (common & api to follow). Manually adding |
Ok, with the above 2 PRs, the initial issues are resolved as of ^0.33.35 onwards. (Some playing in-between trying various options, hence skipping a couple of patch versions along the way) This includes the original core-js issue and the TextEncoder/Decoder issue. However, it is still not operational on RN as of yet, the environment has some peculiarities. Not out of the woods. The basic approach is to find the module, a replacement for it on npm, install test. Next issue. (The way RN bundles info from Node-components is very different from the way it does it for the browser, hence having to provide replacements.) This seems to work, by including Feeling like hitting a brick wall after some iterations over The App I'm testing is really simple, not great, not useful, but indicates the issues -
|
Now, this is error is resolved,
But, got another error about "chalk", I am solving it, now. :
The polkadot Api v0.33.25, used the "chalk": "^2.4.1", |
The color/chalk we can remove, it only gets used in the client repo really. |
Solution for now is: /node_modules/@polkadot/util/logger.js
/node_modules/@polkadot/dev/scripts/polkadot-dev-yarn-only.js
Reference : facebook/react-native#18375 |
Then, Got another issue:
|
core-js/modules/es6.regexp.to-string
Unable to resolve module |
I fix it follow the repo https://github.com/jacogr/pjs-rn-rncli. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
polkadot Api version :
This React-Native project create way is :
react-native init Project
packages:
When I import the @polkadot/api to React Native project. get the error:
The text was updated successfully, but these errors were encountered: