gistpad icon indicating copy to clipboard operation
gistpad copied to clipboard

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

Open fleps opened this issue 1 year ago • 4 comments

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))

  • VS Code Version Version: 1.90.0 (user setup) Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T19:33:54.889Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631 -

  • GistPad Version v0.6.0


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.

fleps avatar Jun 13 '24 13:06 fleps

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

maziac avatar Nov 06 '24 16:11 maziac

The error when trying to refresh the list should now be resolved. But I need to look into seeing why image paste might have regressed. Apologies for the inconvenience!

lostintangent avatar Feb 16 '25 19:02 lostintangent

Not sure. Maybe this particular error is gone but I see a lot of these errors:

2025-02-20 22:17:04.010 [info] ExtensionService#_doActivateExtension vsls-contrib.gistfs, startup: false, activationEvent: 'api', root cause: yzhang.markdown-all-in-one
2025-02-20 22:17:05.630 [error] Error: Not Found
    at l (/Users/bob/.vscode/extensions/vsls-contrib.gistfs-0.7.0/dist/extension.js:2:59627)
    at /Users/bob/.vscode/extensions/vsls-contrib.gistfs-0.7.0/dist/extension.js:2:60649
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _ (/Users/bob/.vscode/extensions/vsls-contrib.gistfs-0.7.0/dist/extension.js:2:772890)
    at async Promise.all (index 2)
    at /Users/bob/.vscode/extensions/vsls-contrib.gistfs-0.7.0/dist/extension.js:2:769916
    at async Promise.all (index 3)
2025-02-20 22:17:14.807 [error] ExtensionError: Error in extension vsls-contrib.gistfs: FAILED to handle event
    at Ah.value (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:172:35498)
    at D.B (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2373)
    at D.C (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2443)
    at D.fire (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2660)
    at yH.$acceptModelChanged (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:106927)
    at Uy.S (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:114979)
    at Uy.Q (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:114759)
    at Uy.M (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:113848)
    at Uy.L (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:112953)
    at Ah.value (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:111750)
    at D.B (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2373)
    at D.fire (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2591)
    at Xn.fire (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:9458)
    at Ah.value (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:190:13296)
    at D.B (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2373)
    at D.fire (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2591)
    at Xn.fire (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:9458)
    at MessagePortMain.<anonymous> (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:190:11588)
    at MessagePortMain.emit (node:events:518:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2949)

maziac avatar Feb 20 '25 21:02 maziac

Yeah I think the image upload got busted and I need to look at it next week when I'm back from spring break.

lostintangent avatar Apr 17 '25 16:04 lostintangent

This is actually a duplicate of #354

lostintangent avatar Aug 07 '25 06:08 lostintangent