ArweaveTeam / arweave-js

Browser and Nodejs client for general interaction with the arweave protocol and gateways
MIT License
592 stars 129 forks source link

React Native app startup with Metro bundler #233

Open Doublemme opened 3 hours ago

Doublemme commented 3 hours ago

When I launch the app with Metro bundler the bundle fails with this error when I updated the library to the latest version

Unable to resolve module node:crypto from ~/MyApp/node_modules/arweave/node/lib/crypto/node-driver.js: node:crypto could not be found within the project or in these directories:
  node_modules/arweave/node_modules
  node_modules
  25 | Object.defineProperty(exports, "__esModule", { value: true });
  26 | const pem_1 = require("./pem");
> 27 | const crypto = __importStar(require("node:crypto"));
     |                                      ^
  28 | class NodeCryptoDriver {
  29 |     keyLength = 4096;
  30 |     publicExponent = 0x10001;

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
0x0
rosmcmahon commented 2 hours ago

can you check with latest version arweave@1.15.5, should fix this i think

rosmcmahon commented 2 hours ago

i made an assumption there, ...was it working with a previous build?

Doublemme commented 2 hours ago

With the 1.13.7 version everything was working fine, I'll try to update and let you know if everything is ok or not. Thanks for the quick support