In Firefox, connection .... was interrupted while the page was loading
Hi, it shows connection to ws:..... was interrupted while the page was loading in Firefox but works. I saw many possible fix suggestions on different sites but none of them work now. It works fine in other browsers without any error/warning in the console. I am using socket.io 1.3.4 and firefox latest version 35.0.1.
Same here, random disconnect on firefox, not on chrome. I can't understand what is the problem.
It still happens on the latest version 1.3.6
There's an open ticket for this on Bugzilla. The "workaround" doesn't work for me.
This will fix it window.onload(function() { //code goes here });
Issue is still alive apparently getting the exact same error, I've tried both versions 1.2.0 I believe and the one that comes with the latest NPM package. Any workarounds?
I too am getting the same error in Firefox. Can't seem to find a fix anywhere.
I'm getting this error in FF 45 and my websocket connection times out.
I am getting this error on FF 46 + Mac, FF 45 + Windows 10.
For us the problem was the version of the net scaler we used
Are you referring to the python script net scaler? I am not using it and still getting this error on socket.io
Had the same issue on OS X 10.11.5 and Firefox 47. With the following configuration it works without errors for me on Firefox 47 and Chrome 51.0.2704.103.
package.json
{
"name": "socket-io-test",
"version": "1.0.0",
"description": "socket io test",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"repository": {
"type": "git",
"url": ""
},
"keywords": [],
"author": "Aleksandar Gotev",
"license": "ISC",
"homepage": "",
"dependencies": {
"express": "^4.14.0",
"socket.io": "^1.4.8"
}
}
config.json
{
"process_title": "wstest",
"web_server_port": 3000,
"max_seconds_to_wait_on_kill": 3
}
app.js
var expressFramework = require('express');
var express = expressFramework();
var fs = require('fs');
//read configuration
var configuration = JSON.parse(fs.readFileSync('config.json', "utf8"));
//setup express
express.set('json spaces', 2);
express.disable('x-powered-by'); //disable express framework credits
express.use("/", expressFramework.static(__dirname + "/static")); //serve static files
//start web server
var webServer = express.listen(configuration.web_server_port, function () {
console.log("Web server listening on port " + configuration.web_server_port);
});
//setup socket.io
var io = require('socket.io')(webServer);
io.on('connection', function (socket) {
socket.emit('hello', {
msg: "hello"
});
});
//setup process
var killHook = function killHook() {
console.log("Detected kill signal");
webServer.close(function() {
console.log("Graceful shutdown");
process.exit(0);
});
setTimeout(function () {
console.log("Waited for " + configuration.max_seconds_to_wait_on_kill + " seconds. Force kill.");
process.exit(0);
}, configuration.max_seconds_to_wait_on_kill * 1000);
};
process.title = configuration.process_title;
process.on('SIGTERM', killHook);
process.on('SIGINT', killHook);
static/index.html
<html>
<head>
<title>WS Test</title>
</head>
<body>
<script src="/socket.io/socket.io.js"></script>
<script>
window.onload = function() {
var socket = io.connect('http://localhost:3000');
socket.on('hello', function (data) {
document.write("<p> Hello message: " + JSON.stringify(data) + "</p>");
});
window.addEventListener("beforeunload", function() {
console.log("Close web socket");
socket.close();
});
};
</script>
</body>
</html>
Just recreate the files in a directory and then execute:
npm install
npm start
And head your browser to http://localhost:3000
Hi all, I was having the same issue.. By using socket io 1.0.* my errors fixed . Hope this helps.
Any updates on this? Because this is issue also affects Firefox 51.0.1
I get the same error but the connection works perfectly, strange...
Set network.notify.ipv6 to false.
still an issue on firefox quantum release
@nagarjunbn It actually does resolve the issue for me as well. I used the latest socket.io available: "socket.io": "2.0.4"
and the below issue is gone: The connection to http://localhost:55542/dist/__webpack_hmr was interrupted while the page was loading.
Still getting this error with 2.0.4, Firefox Quantum (58.0), macOS 10.12.6:
The connection to http://localhost:4000/__webpack_hmr was
interrupted while the page was loading.
FF Quantum is sending a PING. Is there a socket.io handler implementation for WebSocket ping/pong? Could this be the issue?
This error suddenly popped up in my Vue project when starting to use vuetify. Firefox 59.0.2 (64-bit) on Ubuntu. No errors in Chrome. A bit later the error changed to: Firefox can’t establish a connection to the server at http://localhost:8080/__webpack_hmr.