1

I'm getting this error while importing the Socket into my React Component Socket Error Refernce

I'm using "react": "^17.0.2", and "socket.io-client": "^4.3.1" versions.

I have only added this line and it comes up with this error

React Component

I have also tried without { } (curly brackets) but nothing changed. I searched google a lot but all having the same king of import and works well for them. Whats going wrong for my case ?

2
  • Does this answer your question? Implementing Socket.io with ReactJS ES6 Commented Oct 16, 2021 at 12:13
  • Downgrade socket.io-client to v4.2.0 for now. The bugs introduced due to ESM builds are being resolved. It may take up to 2-3 days for the latest version to become stable enough to use. Commented Oct 16, 2021 at 19:39

1 Answer 1

1

Don't know how but deleting the node_modules folder and reinstall all packages fresh is solved my problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.