Closed Patrice-expleo closed 8 months ago
Your suggested fix sounds good; I'll include it in the upcoming 6.x
release.
Before I backport it to 5.x
- does this allow you to work around the issue?
const buffer = require('buffer');
buffer.SlowBuffer = buffer.Buffer;
Thanks for the reply. In my case, setting the Buffer flag of vitePolyfills (in vite.config) to false will be the workaround. It is true for default.
@mtth did you backport this fix to 5.x? I'm running into this and having to monkey patch stuff to fix it...
Hi everybody,
I am updating my project from VITE4 to VITE5 using your library. Compilation is correct but in the browser got the error message:
Uncaught TypeError: SlowBuffer is not a function
When I look at the stacktrace I can see you are using
new SlowBuffer(1024)
forvar TAP
. This call is deprecated since version 6 of node.Is there a possibility for a workaround or a fix? The fix would be done very fast, cause you can use
Buffer.allocUnsafeSlow
instead.I already was importing vite-plugin-node-polyfills, but that does not resolve the error.
Best regards