-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Git: Cannot read property 'resourceUri' of undefined #35724
Comments
Must be a new issue since you are on 1.17.0. |
Version 1.17.0 (1.17.0)
|
@maxibanki @pftbest Does the issue reproduce easily? |
It happened just one time while i was on work. No way to reproduce it currently as i know. |
Happening as I am typing this. Hope this helps |
One workaround I found was to open a different folder, and then go back to opening the original folder. The issue appeared to fix itself then. |
Same message when trying to stage changes done in an untracked folder. Worked around it by manually adding the folder with |
Having this issue when trying to stage changes as well as clicking on the file and trying to see the diff. Worked smoothly before an update |
It happened to me twice yesterday, and in both cases i was editing files that where outside of current workspace but in the same git repo. |
It happened with c++ when I've tried to add a new source file. |
I have a bunch of files right now project that is like these, but other files are fine. Is hard to reliably reproduce as only some files sometimes becomes problematic. If I restart vscode all files can be fine. I've seen this in multiple projects which differ quite a bit so I have no idea what the common thing could be. |
Add the particular files by going to the directory in your terminal(right click on the folder in your project and open it in terminal) and add all the files you want. |
me too |
try to perform action using terminal, it worked for me, |
This seems very hard for me to reproduce. It's very possible that 9e9f809 fixed it. But not sure... I'l close it for now. Please try the latest Insiders release or the upcoming November stable release (available next week) and let me know if you still see the issue. |
@joaomoreno I had the issue again with this version:
So the commit 9e9f809 doesn't fixed the issue. I opened the SCM sidebar and tried to type in a Git commit message. After that I want to view the difference for some files. |
on version 1.18.0 as well. sporadic but a lot of files I can't stage changes or view the changes. Git: Cannot read property 'resourceUri' of undefined. +1 to make this high priority |
Getting this aswell on 1.18.0, seems hard to reproduce |
Me too for 1.18.0, if I have eg. 10 files to commit there is certainly at least one of them which fails with this message |
This has actually gotten seemingly worse for me since my most recent update (1.18.0). Not only am I seeing the resourceUri error, but in some cases I can't even open the file from the source control tab. Right now I have a file in "Changes" and double clicking it does nothing -- it doesn't open it (or the diff), and I don't even get any sort of error. If I try to stage it I still get the "Git: Cannot read property 'resourceUri' of undefined" error message." As everyone else is reporting, using the command line works just fine (and the source control tab updates accordingly), so it's not a huge problem for me, just a minor annoyance. Unfortunately I haven't found a reliable way to reproduce this, but it's happening often enough for me that if anyone has any ideas I'm happy to test them out. |
Guys, if you open the Developer Tools, is there any warning in there? |
Another possible workaround: pass by your terminal and add manually the file VS Code You'll be able to see the differences through the editor then. |
Hmm, for me it has always been that way. However the file can still be opened from the file tree. |
Questions for those who hit this:
|
In my case only the output (of the first post in this issue) was logged. I haven't used or installed any other SCM provider. |
I get this in the Developer Tools console when a file won't open: And to answer your other question @joaomoreno - I only have one SCM repository. |
The bug is there! When I've tried to stage only with some (apparently random) files I've had the problem. Recently also the git.autorefresh does not work! |
In the developper tools i've found this: messageService.ts:126 GIT: Cannot read property 'resourceUri' of undefined |
Also available on OSX 10.12.6 vscode 1.18.0 Tried to add a modified file to stage. got two messages: messageService.ts:126 Git: Cannot read property 'resourceUri' of undefined console.ts:123 [Extension Host] ApplicationInsights:Sender [Object]0: Objectaddress: "40.77.226.250"code: "ECONNREFUSED"errno: "ECONNREFUSED"port: 443syscall: "connect"proto: Objectconstructor: function Object()hasOwnProperty: function hasOwnProperty()isPrototypeOf: function isPrototypeOf()propertyIsEnumerable: function propertyIsEnumerable()toLocaleString: function toLocaleString()toString: function toString()valueOf: function valueOf()defineGetter: function defineGetter()defineSetter: function defineSetter()lookupGetter: function lookupGetter()lookupSetter: function lookupSetter()get proto: function proto()set proto: function proto()length: 1__proto__: Array(0)concat: function concat()constructor: function Array()copyWithin: function copyWithin()entries: function entries()every: function every()fill: function fill()filter: function filter()find: function find()findIndex: function findIndex()forEach: function forEach()includes: function includes()indexOf: function indexOf()join: function join()keys: function keys()lastIndexOf: function lastIndexOf()length: 0map: function map()pop: function pop()push: function push()reduce: function reduce()reduceRight: function reduceRight()reverse: function reverse()shift: function shift()slice: function slice()some: function some()sort: function sort()splice: function splice()toLocaleString: function toLocaleString()toString: function toString()unshift: function unshift()Symbol(Symbol.iterator): function values()Symbol(Symbol.unscopables): Object__proto__: Object |
OK GUYS! I got it, finally. Steps:
Keep reading for a postmortem analysis. Here's where the bug is: We're basically dealing with a list of changes, sorted by the occurring index in the original sequence, and applying the same changes into a another list. This, of course, is a problem if the difference between the number of inserted elements is different than the number of deleted elements in that change, since the index positions for the following changes will all be wrong. The usual way to do this is to reverse the list of changes and apply them in that order. We do this in the main thread: But we overlooked doing the same when dealing with the Combine that with the fact that we only really dispose these guys 10 times after a resource group was effectively modified (that's why step 3 of the repro steps needs to be repeated 5 times), this bug proved to be a very elusive one. I'll fix the order of handling these splices. I'll also remove the 10 generations before disposing... we can deal with that in some other way. |
Should this error be gone in the most recently shipped version? (I'm not using the insiders build) I just got it. |
This fix is already out in Insiders but will come in the next Stable (1.19.0). |
Any idea when Stable v1.19.0 will be released? I'm seeing this error often and it's beginning to get annoying. :) |
Should be released in the next one or two weeks |
I have just had this happen when staging multiple files, I followed some advice seen above, changed folder, came back to project and all is well. |
(1 theme extensions excluded)
Steps to Reproduce:
Developer Tools:
Reproduces without extensions: Yes/No
The text was updated successfully, but these errors were encountered: