I'm facing with a mysterious error. When I'm trying to send one specific query to the server, I'm receiving the following error
DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
at dispatchXhrRequest (http://localhost:6789/static/js/20.chunk.js:180790:13)
at new Promise (<anonymous>)
at xhrAdapter (http://localhost:6789/static/js/20.chunk.js:180773:10)
at dispatchRequest (http://localhost:6789/static/js/20.chunk.js:181396:10)
And here I logged the actual url string
http://localhost:3000/users/5/payments/disconnect
If I send the same query but from my hosting to dev server, I see error 404 and url like this
https://example.com/users%E2%80%8B/5%E2%80%8B/payments%E2%80%8B/disconnect
This is my function which sends the query
const query = `${url}/users/${userId}/payments/disconnect`;
console.debug('Url', query);
try {
const { status } = await axios.delete(query);
return status;
} catch (e) {
console.debug(e);
return 500;
}
}
Interesting thing, all other endpoints work fine. The same behavior on chrome and firefox.
What can cause problems like this?