socket.io-client: TypeError: Cannot assign to read only property 'exports' of object '#
Hi guys, I updated the latest version of Socket.IO-Client and started giving this error.
Someone knows what it is ?

{
"name": "aheadpro-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"socket.io-client": "^4.3.1",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (1 by maintainers)
Commits related to this issue
- fix: restore the default export (bis) The previous commit, while successfully restoring support for: ```js const socket = require("socket.io-client")(...); ``` breaks for some other cases: - https... — committed to socketio/socket.io-client by darrachequesne 3 years ago
- fix: restore the default export (bis) The previous commit, while successfully restoring support for: ```js const socket = require("socket.io-client")(...); ``` breaks for some other cases: - https... — committed to sunrise30/socket.io-client by sunrise30 3 years ago
This should be fixed in version 4.3.2, sorry for the mess.
same,I try to downgrade it but doesn’t work,weird
this broke production code a hell of an issue to solve. Usually, things happen but this was a big miss. How come there was no testing done.
I had to downgrade to 4.2.0 for it to get in the working state back. The ^ in package json caused it to bump to next version.
but, i recommend downgrading
socket.io-clientversion to4.3.0. you can using this command.npm remove socket.io-clientnpm install socket.io-client@4.3.0i have same problem too… hope this will be fixed soon…
Can confirm, downgrading to 4.3.0 or below solves the issue. Hope this gets fixed soon, this brought our whole site down.
This is so sad