solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
2.13k stars 853 forks source link

Module `assert` does not exist in the Haste module map #287

Closed YukunLee closed 1 year ago

YukunLee commented 5 years ago

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios) with error:(Unable to resolve module assert from /Users/lee/Desktop/React/node_modules/@solana/web3.js/lib/index.cjs.js: Module assert does not exist in the Haste module map

mvines commented 5 years ago

Hi thanks for reporting this. Can you please share more details on how to reproduce this issue?

YukunLee commented 5 years ago

Running on iOS with React Native, 'yarn add @solana/web3.js' and import web3 from '@solana/web3.js',then arise the issue.

"dependencies": {
    "@solana/web3.js": "^0.14.18",
    "react": "16.8.3",
    "react-native": "^0.59.4"
}

import web3 from '@solana/web3.js';

I'm a beginner. Feel guilty for causing your trouble.

mvines commented 5 years ago

Oh React Native. We don't currently support React Native. It would be possible to add support RN but I imagine it would be a bit of work, possibly with adding some native bindings for the crypto libraries we make use of

YukunLee commented 5 years ago

I see,Thank you very much for your answer.

mvines commented 5 years ago

Next steps on this issue would be to investigate adding React Native support by somebody who is motivated to do so :)

EnettyTech commented 4 years ago

Follow https://gist.github.com/bachlongkocanh/1617f339c779db36b6f1528dc68b5d96 to install web3, ethers, solana/web3 for React Native.

steveluscher commented 1 year ago

We're now compatible with React Native!

github-actions[bot] commented 1 year ago

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.