-
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
No browser debug output in >4.3.2 #5108
Comments
You are right, this is indeed a side effect of socketio/socket.io-client@16b6569 (rationale here). I'm open to suggestions on how to elegantly fix this. |
https://socket.io/docs/v4/logging-and-debugging/ should be at least updated to reflect
|
Is there currently no way to get any debug messages from |
@darrachequesne @possi how should I import the socket io client from node modules with debug? |
No workaround? |
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 is not the proper workaround and ONLY a temporary fix that I did to get debug working on my end to try debug an issue I was having keeping a websocket connection alive. I manually added
Into the exports property within the socketio client package.json within the node_modules folder of the npm package itself. This allowed me to update my projects socketio client import from socketio-client to socketio-client/build/esm-debug. I have reverted this change after I successfully solved my issue to not bring any unwanted sideeffects in the future. Remember that this is not a proper workaround. |
seriously, this should be stated in the docs |
presumably this problem is also in the versions on (various) CDNs? because they don't work for me either |
I set
it had no effect - I don't see any log output. |
Did you update the import from EDIT: |
Describe the bug
When using
socket.io-client
version4.3.2
and above in an app created withcreate-react-app
, there is no browser debug output at all withlocalStorage.debug = '*'
. Version4.2.0
is the latest version I found that did produce correct debug output.To Reproduce
react-scripts start
localStorage.debug = '*'
in the consolePlease fill the following code example:
Socket.IO server version:
4.4.0
Server
Socket.IO client version:
4.3.2
Client
Expected behavior
When reloading the page, there should be debug output written to the browser console. With version 4.2.0, the debug output is written. With version 4.3.2 and 4.4.0, there is no output.
Platform:
Additional context
I haven't tested this in the browser outside of a React app. I included information about the React environment in case react is somehow messing with the debug content.
The text was updated successfully, but these errors were encountered: