-
Notifications
You must be signed in to change notification settings - Fork 3k
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
4.3.0 Buffer is not defined #1504
Comments
Arf, now that the dev build is fixed (socketio/engine.io-client@4971914), it's the production build that fails... I'm digging into this. |
Some bundlers (like vite) do not support having a "browser" field in a nested package.json. Related: socketio/socket.io-client#1504
Some bundlers (like vite) do not support having a "browser" field in a nested package.json. Note: the previous commit ([1]) fixed the resolution of the "browser" field in the dev bundle, but the production bundle still failed. Related: socketio/socket.io-client#1504 [1]: 4971914
It should be fixed in latest version (4.3.1), could you please check? |
Nope it's still the same. And error is in runtime, not during the build. |
@faradaytrs I cannot reproduce with latest version: https://github.com/socketio/socket.io-fiddle/tree/vite Could you please check? |
Hello, I had the same issue even after the fix (4.3.2). I use
My main project used the |
I have similar situation with @tcastelly, but my dependency doesn't have esm build. It relies on socket.io-client as peer dependency though. |
After I updated dep to use esm it works, but I believe it might be a problem in many cases for many people. |
We are running into this problem when users are building Uppy with Vite: transloadit/uppy#3265. It's currently blocking people from going to production. I investigated and this seems to be a dual publishing issue. If you import Here is a minimal reproducible example: Note: this zip includes the The const io = require('socket.io-client')
module.exports = io To see the error:
As this is blocking our customers I'm willing to contribute to fix this but I would need some pointers to get started. As far as I know the buffer usage comes from engine.io-client. |
Related: socketio/socket.io-client#1504 Backported from master: c557707
@Murderlon I could indeed reproduce the issue, thanks a lot for the sample project 👍 This should be (finally!) fixed by socketio/engine.io-client@9fcaf58, included in Please reopen if needed. |
Describe the bug
After i compile app in production mode in vite (it uses rollup). I get the following error:
Buffer is not defined at constants.js:5
Socket.IO client version:
4.3.0
Platform:
Additional context
I use Vercel for compilation, but i think problem is not with Vercel
The text was updated successfully, but these errors were encountered: