-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
safe-buffer in modern build tools like Vitejs #30
Comments
Hi @mecirmartin, I have the same issue in Sveltekit (which uses Vite). While trying to debug I noticed than bn also uses Buffer and the initialization is more involved and adapted to a bowser context.
Please submit your PR, I'm interested. |
Adding buffer to node_modules fixed this for me.
No need to change the safe-buffer package. |
I have the same problem in ViteJs |
This worked even though i don't know why, thank you so much. |
This should absolutely result in a change in |
I suddenly faced the same issue and the error occured during a code change. Everything was working before. Maybe that helps someone :) |
I installed react-xml-viewer. Then my app failed with errors mentioning safe-buffer. Following above comments I added buffer as dependency which solved the issue. Please declare this dependency. |
It helped me, thank you. For some reason { token } was imported from 'morgan' |
Hey, i'm trying to use ViteJs for project.
Since this is es6 only, the code errors out inside safe-buffer package
Buffer
is undefined hereIf we included this simple check, this wouldn't error out in ViteJs environment.
Is there any reason not to include check like this? If you would be interested, i could submit PR
The text was updated successfully, but these errors were encountered: