I am seeing this error Uncaught ReferenceError: window is not defined
in my chrome extension when I update the socket.io library from v2.3.0
to v3.1.0
If I leave the old socket.io client, it seems unable to work with socket.io server 3.1.0
(I see this message on the request from browser developer tools network tab: {"code":5,"message":"Unsupported protocol version"}
with an http 400 bad request
)
Is there an issue with socket.io v3.x and chrome extension?
thank you
v3 change way for setup: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/index.html
Сrucial point it's explicitly, set cors policy in initialization:
const io = new Server(server, { cors: { origin: "*" } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With