lostintangent / gistpad

VS Code extension for managing and sharing code snippets, notes and interactive samples using GitHub Gists
https://aka.ms/gistpad
MIT License
946 stars 61 forks source link

Error to upload image, error to refresh, multiple errors on Extension Host output #358

Open fleps opened 5 months ago

fleps commented 5 months ago

Describe the bug I've been using it for months now, and the basic features still works normally - I can create Gists, edit, rename, etc.

Today I tried to add an image to a Markdown Gist file, following the extension guide, and all went hell.

First, I tried to paste an image copied directly from an editor, I got this error on a popup:

Error applying edit 'Insert Markdown Image': Unable to write file 'gist://984954219ddfd9dd9d048e5d9324a616/graph.png' (Error: fatal: couldn't find remote ref master )

If then tried to use the "Upload File" context menu on the Gists list, it will insert a broken image on the Markdown, it will show the "Uploading file", and then nothing happens (no error appears, no image is uploaded).

I then tried to hit the refresh button on the extension, which doesn't work and shows the below error:

Error running command gistpad.refreshGists: Cannot read properties of undefined (reading 'appendLine'). This is likely caused by the extension that contributes gistpad.refreshGists.

I then tried each step multiple different ways, with different images, and decided to check the Extension Host output, which I then noted that even when the error popup doesn't appear (using the "Upload File" option), the same first error as above happens on the Extension Host.

And then after this error, the Extension Host will start going hell with multiple errors per second with the below message:

2024-06-13 10:40:17.274 [error] Error: [ExtensionListenerError] Extension 'vsls-contrib.gistfs' FAILED to handle event: TypeError: Cannot read properties of undefined (reading 'document') at n.value (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:163:20749) at l.y (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:664) at l.z (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:734) at l.fire (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:950) at S.$acceptModelChanged (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:153:81758) at E.S (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:5970) at E.Q (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:5736) at E.M (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:4762) at E.L (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:3589) at n.value (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:2282) at l.y (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:664) at l.fire (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:881) at s.fire (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:107:14502) at n.value (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:176:8481) at l.y (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:664) at l.fire (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:82:881) at s.fire (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:107:14502) at MessagePortMain.<anonymous> (c:\Users\flep\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:176:6631) at MessagePortMain.emit (node:events:514:28) at MessagePortMain.emit (node:domain:488:12) at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285)

It will stay outputting the above until I disable the extension and enable it again.

When I enable it again, it also shows some other errors (but at least they stop):

2024-06-13 10:42:05.996 [error] TypeError: Cannot read properties of undefined (reading 'appendLine') at Object.get followedUsers [as followedUsers] (c:\Users\flep\.vscode\extensions\vsls-contrib.gistfs-0.6.0\dist\extension.js:2:780311) at t.refreshGists (c:\Users\flep\.vscode\extensions\vsls-contrib.gistfs-0.6.0\dist\extension.js:2:776491) at processTicksAndRejections (node:internal/process/task_queues:95:5) at y (c:\Users\flep\.vscode\extensions\vsls-contrib.gistfs-0.6.0\dist\extension.js:2:778251) at v (c:\Users\flep\.vscode\extensions\vsls-contrib.gistfs-0.6.0\dist\extension.js:2:778699) at t.initializeAuth (c:\Users\flep\.vscode\extensions\vsls-contrib.gistfs-0.6.0\dist\extension.js:2:779191)

2024-06-13 10:42:32.356 [error] [vsls-contrib.gistfs] provider FAILED 2024-06-13 10:42:32.356 [error] TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))


As I said, I can still use it to keep editing my files, but would like to understand what is going on and how to fix this, so I can use the images with it.

I do have 2 Markdown extensions related to Markdown edits/previews, but even with them disabled the same happens, so no idea what's going on.

maziac commented 1 week ago

I also see the error about "TypeError: Cannot read properties of undefined (reading 'appendLine')" as well.