You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my project, the URL is different based on the env.
Following socketIO Client docs, it says the default value of url in io(url) is window.location. So my code was like this:
The request returns a 400 BAD REQUEST, ignoring the query passed and it reloads the page.
In my case, the io() was called on the page load, so this created a constant page refreshing loop.
Change `window.location` to `window.location.host`. If
`io(window.location)` is started, it works, but then if we pass
`options`, those are ignored.
Related:
- #139
- #343
Problem
On my project, the URL is different based on the env.
Following socketIO Client docs, it says the default value of
url
inio(url)
iswindow.location
. So my code was like this:In development this is the log output: (correct)
But in production env, it doesn't work.
The request returns a 400 BAD REQUEST, ignoring the query passed and it reloads the page.
In my case, the
io()
was called on the page load, so this created a constant page refreshing loop.Solution
The problem is the incorrect
window.location
passed toio()
. It should bewindow.location.host
.I'll open a PR to the docs with this change.
The text was updated successfully, but these errors were encountered: