socket.io-client.js: Cannot access 'XMLHttpRequest' before initialization #1592
Replies: 3 comments
-
Seems to be related to #62? As a workaround importing like this works: |
Beta Was this translation helpful? Give feedback.
-
Get the same error with vitejs I simply call
I've tried
|
Beta Was this translation helpful? Give feedback.
-
Stephanie, I can confirm this workaround works fine. Thanks a lot! /T |
Beta Was this translation helpful? Give feedback.
-
Hi.
Using Snowpack with with
socket.io-client
+react
renders an exception, but running it with traditional React works fine. The bug might be in socket.io:s code, but I don't think so. Note, there are information how to workaround the problem at the end (for now).Steps to reproduce
Workaround
Looking into
\.cache\snowpack\development\socket.io-client.js
it's this line that fails. I cannot find this line in the socket.io-client code.const XMLHttpRequest = XMLHttpRequest;
...and removing the line resolves the error.
/T
Beta Was this translation helpful? Give feedback.
All reactions