-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Missing "./build/esm-debug" specifier in "socket.io-client" package #4635
Comments
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 {
// ...
"exports": {
"/debug": {
"import": "./build/esm-debug/index.js",
"require": "./build/cjs/index.js",
"types": "./build/esm/index.d.ts"
}
},
} And then: Reference: https://nodejs.org/api/packages.html#package-entry-points What do you think? |
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? |
So that debug logs can be printed with vite: ```js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], server: { port: 4000 }, resolve: { conditions: ["development"] } }) ``` Reference: https://v2.vitejs.dev/config/#resolve-conditions Related: - socketio/socket.io#4731 - socketio/socket.io#4635 - https://github.com/socketio/socket.io-client/issues/1516
This should be fixed by socketio/socket.io-client@781d753, included in version 4.7.0. Please reopen if needed. |
Describe the bug
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 inTo Reproduce
localStorage.debug = "*"
No logs shown.
Server
socket.io 4.6.1
Client
socket.io-client 4.6.1
Expected behavior
Show debug statements in browser
Not possible
Platform:
Edge and Firefox
Vite
Additional context
The text was updated successfully, but these errors were encountered: