kinecosystem / kin-node

DEPRECATED! Please use Kinetic: https://developer.kin.org/docs/kinetic
https://developer.kin.org/docs/kinetic
MIT License
16 stars 14 forks source link

NPM Failures on React Native using @kinecosystem/kin-sdk-v2 #17

Closed danieltrinh-ember closed 3 years ago

danieltrinh-ember commented 3 years ago

Hello, we are trying to use the kin sdk on react native and use the package. However we are getting the following error stacktrace when we try to use the sdk within our JS code.

We are executing the following code after a successful npm install of the sdk: import {Client, Environment} from "@kinecosystem/kin-sdk-v2";

However, this immediately throws the following error, in addition I had to install other dependencies not included during the sdk install such as fs: error: bundling failed: Error: While trying to resolve modulesuperstructfrom file/Users/daniel/Documents/Ember/ember-app/node_modules/@solana/web3.js/lib/index.browser.esm.js, the package/Users/daniel/Documents/Ember/ember-app/node_modules/@solana/web3.js/node_modules/superstruct/package.jsonwas successfully found. However, this package itself specifies amainmodule field that could not be resolved (/Users/daniel/Documents/Ember/ember-app/node_modules/@solana/web3.js/node_modules/superstruct/lib/index.cjs. Indeed, none of these files exist:

Can you please diagnose this issue? Thanks!

beeman commented 3 years ago

Hi @danieltrinh-ember - the package in this repo is for Node.js, and won't work in React Native.

We are about to publish the React Native SDK in Beta, but it's not fully published yet.

However, you can already work with it!

I think the easiest way to get started with Kin on React Native at this moment is using the starter kit:

https://github.com/kintegrate/kin-starter-react-native

The README should have instructions on how to clone/run the project. Please file any issues you find at that repo or join our developer Discord.

danieltrinh-ember commented 3 years ago

Thank you @beeman! We will get started on that right away