Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Buffer is not defined #20

Open
vikil143 opened this issue Nov 25, 2020 · 9 comments
Open

ReferenceError: Buffer is not defined #20

vikil143 opened this issue Nov 25, 2020 · 9 comments

Comments

@vikil143
Copy link

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
Copy link
Owner

zmitton commented Dec 17, 2020

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

@vikil143
Copy link
Author

vikil143 commented Dec 18, 2020

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
Copy link
Owner

zmitton commented Dec 19, 2020

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 added a commit that referenced this issue Dec 19, 2020
@zmitton
Copy link
Owner

zmitton commented Dec 19, 2020

fixed

please pull latest version (2.1.5) from npm

@vikil143
Copy link
Author

hey it still gives same error when i install latest version

@vikil143
Copy link
Author

@zmitton hi please help me how to tackle issue

@zmitton
Copy link
Owner

zmitton commented Dec 25, 2020

All my dependencies seem to be correct

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

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

@zmitton
Copy link
Owner

zmitton commented Dec 25, 2020

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

@calvinmetcalf
Copy link

are you on webpack 5 per-chance ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants