-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ungit stopped working on Chrome 57 #887
Comments
Can't confirm on same chrome version on linux. From your console output:
cast @codingtwinky |
The error thrown seems to be caused by an XHR returning status 0 for Server.prototype._httpJsonRequest = function(request, callback) {
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
// It seems like you can get both readyState == 0, and readyState == 4 && status == 0 when you lose connection to the server
if (httpRequest.readyState === 0) {
callback({ error: 'connection-lost' });
} else if (httpRequest.readyState === 4) {
var body;
try {
body = JSON.parse(httpRequest.responseText);
} catch(ex) { body = null; }
if (httpRequest.status == 0) {
callback({ error: 'connection-lost' }); // <--- error is thrown here
}
else if (httpRequest.status != 200) callback({ status: httpRequest.status, body: body, httpRequest: httpRequest });
else callback(null, body);
}
}
var url = request.url;
if (request.query) {
url += '?' + this._queryToString(request.query);
}
httpRequest.open(request.method, url, true);
httpRequest.setRequestHeader('Accept', 'application/json');
if (request.body) {
httpRequest.setRequestHeader('Content-Type', 'application/json');
httpRequest.send(JSON.stringify(request.body));
} else {
httpRequest.send(null);
}
} Properties of {
"method": "GET",
"url": "/api/log",
"query": {
"path": "/home/leon/Development/immutablets",
"limit": 25,
"skip": 0,
"socketId": 0
}
} Opening the endpoint directly in a new tab returns HTTP 200 and a proper JSON body. I can reproduce it on every run, if I can provide any more information to narrow it down, let me know. |
I had the same issue. One of my ad blockers was breaking ungit: uBlock Origin. After disabling it on localhost everything went back to normal. |
Can confirm, after unblocking localhost via uBlock origin ungit works like a charm again. Thank you, @guillaumedavidphd ! |
NP :) |
@FredrikNoren do you think this should be documented in the readme? |
@codingtwinky hm guess it doesn't hurt to link to this issue under known issues |
hm actually, maybe what we should do is have a special error message when the server can't be reached? (Rather than the default one). Could say something like "The ungit host program cannot be reached. Make sure it's running, and make sure you're system is configured to allow localhost connections" (with maybe a link to the readme). I don't have time to implement right now but if anyone's interested that might help other people to navigate this issue |
The codebase is rather large, so I didn't dig prior to this suggestion - but couldn't the appropriate CORS headers be added to the ungit server? |
This was not caused by CORS, but by an adblocker preventing an endpoint from loading, resulting in an HTTP status of |
The recent version of Chrome gives me the "Whooops - Something went wrong, reload the page to start over." message.
The same server & directory works in Firefox. Chrome private mode does not fix it either.
Accessing both via localhost or 127.0.0.1 do not work in chrome, both work in Firefox.
Versions:
My server.log (via
ungit --logRESTRequests --logGitCommands --logGitOutput
)Chrome's browser console output.
Any other Information I can provide?
by the way: very nice work on ungit!
The text was updated successfully, but these errors were encountered: