zmitton / eth-proof

Get a merkle-proof from the blockchain. Verify it locally.
MIT License
191 stars 44 forks source link

ReferenceError: Buffer is not defined #20

Open vikil143 opened 4 years ago

vikil143 commented 4 years ago

Hey I m using this package with react-native and i am facing this problem when i import something from this package like this import {GetProof} from 'eth-proof'; it throw error is it this package was supported for react-native

zmitton commented 3 years ago

just use const { GetProof } = require('eth-proof') as it says in the readme

vikil143 commented 3 years ago

just use const { GetProof } = require('eth-proof') as it says in the readme

Yes i import like above but it still gives an error of Buffer is not defined like below image

Screenshot from 2020-12-18 11-27-03

zmitton commented 3 years ago

Oh I see. This is a dependency issue with Buffer I forgot to include that with my package.json file. Thank you for pointing that out.

zmitton commented 3 years ago

fixed

please pull latest version (2.1.5) from npm

vikil143 commented 3 years ago

hey it still gives same error when i install latest version

vikil143 commented 3 years ago

@zmitton hi please help me how to tackle issue

zmitton commented 3 years ago

All my dependencies seem to be correct

The only thing I can find is this issue: https://github.com/feross/safe-buffer/pull/10 but they claim it was fixed, but I dont understand how it could be fixed from this pull request https://github.com/feross/safe-buffer/pull/12

I added a comment, we will see what he says I guess

zmitton commented 3 years ago

otherwise, if you could get a better stack trace it might be helpful

calvinmetcalf commented 3 years ago

are you on webpack 5 per-chance ?