phil294 / GitLG

A free, interactive Git UI for VSCode
MIT License
155 stars 15 forks source link

Development mode throwing errors on windows machines #100

Closed pgsandstrom closed 1 month ago

pgsandstrom commented 4 months ago

When working on another extension I saw these error messages appearing in the debug console once or twice just about everytime I selected a new file:

rejected promise not handled within 1 second: Error: ENOENT: no such file or directory, realpath 'C:\c:\work\code\nopestradamus\server\prediction.ts'
stack trace: Error: ENOENT: no such file or directory, realpath 'C:\c:\work\code\nopestradamus\server\prediction.ts'

I disabled my other extensions one by one until I found that it was caused by this extension.

As you can see the file path has a double c:\ in the beginning. Since it seemed windows-specific I tried it on my mac, and I failed to replicate the problem there.

I cloned your project and tried to start it in vscode debug mode on my windows machine, but the debug mode threw the error below and the extension failed to activate. So indeed it seems windows specific. Though I was a bit confused by the error messages being so different, maybe there are two differens windows issues at play?

Activating extension 'phil294.git-log--graph' failed: Cannot find module 'c:\work\code\git-log--graph\src\extension.js'
Require stack:
- c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js.

I thought it would be an easy fix, but unfortunately I dont understand coffeescript. Maybe its just some easy fix related to the one place where you use fs.

If you dont have access to a windows machine but need to test a solution then just ping me and I'll help out. I love this extension and want it to be as good as possible!

phil294 commented 3 months ago

indeed and I think there's been 2-3 other issues for that. Will have a look at it tomorrow, but I don't have a windows system so unsure if fixable just like that.

phil294 commented 1 month ago

Hi! This error seems to come up in one of the two usages of realpath() in git.js. But I don't understand how the argument passed gets so weird, as it's not constructed by the extension but just passed through from VSCode api calls... 🤔

@pgsandstrom Indeed, it would be very helpful if you would like to have another look at this by checking latest master out again, as I don't have Windows and fail to reproduce this. After cloning, you just need to npm i and cd web; npm run serve (also see here https://github.com/phil294/GitLG/blob/master/CONTRIBUTING.md#building). Exception handling is also improved, so you should see an error message popup in the bottom right as soon as that error reappears, and the stack trace in VSCode's developer tools console should point directly to the place where it goes wrong.

The second problem of yours is resolved because the repository is now free from CoffeeScript and just using normal JS.

GaryOma commented 1 month ago

I have the exact same problem on my windows machine, changing the uri.path to uri.fsPath solved the issue (at least on windows ^^) #107

phil294 commented 1 month ago

Fixed by @GaryOma