Open tudorelu opened 5 years ago
For version 1.1.0
could you please try:
const nuls = require('nuls-js');
const Account = new nuls.Account();
const foo = Account.create();
Tried it, but getting the same error, at the require
statement.
Since you (or someone else, maybe @amalcaraz) mentioned that it works in node and react, but not react-native, I will try using Nodejs Mobile which runs a Node.js worker in the background of the mobile app and import it through that. Will let you know about it. Of course, this is not ideal, but in the meantime it might be useful.
[EDIT] That's more complicated than I initially thought, so it will take a while.
Maybe it has something with the way you're deploying it to npm? I'm thinking there should be a specific procedure to publishing a react-native package to npm, a bit different than that of a nodejs package.
So it appears that React native does struggle to run node libraries, and jimp just isn't compatible (TIL). We can remove JIMP altogether and write our own version as we're only using basic image manipulation.
I'll submit a release of this in a separate branch and we can see if this solves the problem for you for committing.
oh, I see. is that to do with the qr codes? Great, that'd be awesome man!! Let me know if I can help with anything.
When trying to import nuls-js v1.0.3 in my react-native project like so:
import {Account} from 'nuls-js';
I get the following error: