You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am facing this issue when i used import { encrypt } from '@metamask/eth-sig-util';
i am facing this error
i have also tried import {Buffer} from 'buffer';
Can someone please guide me here?
`
The text was updated successfully, but these errors were encountered:
Hi @SyedImam1998, I saw your comment in the other issue. No need to create another issue if it is related. I am going to paste the comment I left there:
Buffer is a class in the Node standard library, so it works in a Node context, but in a browser context, you will probably need to configure your preprocessor to replace this with a polyfill. If you're using Webpack, then you can:
Configure Webpack to use it via the resolve.fallback option. This should allow you to use Buffer in your own code.
Configure Webpack with ProvidePlugin. This should fix dependencies like ethereumjs-util so that anywhere Buffer appears, it is automatically replaced with the class exported by buffer.
Hope that helps. Let me know if you encounter any more issues.
Hey @mcmire would you mind providing an example? I have tried the steps you described but still cannot get Buffer recognized. Here is my webpack.config.js file
I am facing this issue when i used
import { encrypt } from '@metamask/eth-sig-util';
i am facing this error
i have also tried
import {Buffer} from 'buffer'
;Can someone please guide me here?
`
The text was updated successfully, but these errors were encountered: