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
{{ message }}
Repository navigation
Missing "./build/esm-debug" specifier in "socket.io-client" package #4635
The documentation is unable to help me to set up debugging in the client when installed through npm.
It only refers to cdn, but i cannot find anywhere on the Socket IO website or google how to import the esm-debug version.
Importing socket.io-client/build/esm-debug in Vite results in
Internal server error: Missing "./build/esm-debug" specifier in "socket.io-client" package
I would have to check if vite supports that specifically for the client but I have found another way. In vite it is also possible to declare the path to the debug version as resolve alias. Then you can import it with a relative path in the client code, at least on the dev server. There is also some other issue with XMLrequest that can be resolved like this.
Besides that, in the server I also found out that it is possible to toggle debugging on and off by importing debug from debug and calling debug.enable. I prefer this to yet another environment variable.
Activity
darrachequesne commentedon Feb 23, 2023
Hi! We could indeed export the debug build, which is currently only available for the Node.js platform (here).
That being said, I am not sure whether Vite supports the
exportsfield, something like:And then:
import { io } from "socket.io-client/debug"Reference: https://nodejs.org/api/packages.html#package-entry-points
What do you think?
wvhulle commentedon Feb 23, 2023
I would have to check if vite supports that specifically for the client but I have found another way. In vite it is also possible to declare the path to the debug version as resolve alias. Then you can import it with a relative path in the client code, at least on the dev server. There is also some other issue with XMLrequest that can be resolved like this.
Besides that, in the server I also found out that it is possible to toggle debugging on and off by importing debug from debug and calling debug.enable. I prefer this to yet another environment variable.
Maybe this could be documented?
feat: expose ESM build with debug (#1585)
darrachequesne commentedon Jun 23, 2023
This should be fixed by socketio/socket.io-client@781d753, included in version 4.7.0.
Please reopen if needed.