Skip to content
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

[error] TypeError: Cannot read properties of undefined (reading 'document') #335

Open
amnweb opened this issue Aug 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@amnweb
Copy link

amnweb commented Aug 18, 2023

There is output error on VScode start

[error] TypeError: Cannot read properties of undefined (reading 'document')

Screenshot 2023-08-19 003255

I have try to disable all extension only GistPad is enabled and error is still there.

  • VS Code Version v1.81.1
  • GistPad Version v0.4.1
@amnweb amnweb added the bug Something isn't working label Aug 18, 2023
@blech75
Copy link

blech75 commented Oct 21, 2023

i've noticed this a while ago, too. i disabled the extension because of it. 😞

recently, i wanted to use gistpad again, so i re-enabled the extension on the latest vscode:

Version: 1.83.1
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:46:55.789Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin x64 23.0.0

here's a full log message as text:

2023-10-21 17:19:54.441 [error] TypeError: Cannot read properties of undefined (reading 'document')
    at s.value (/Users/justinb/.vscode/extensions/vsls-contrib.gistfs-0.4.1/dist/extension.js:51:186496)
    at c.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at c.A (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1972)
    at c.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2188)
    at w.$acceptModelChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:10094)
    at i.S (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:10827)
    at i.Q (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:10593)
    at i.M (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:9683)
    at i.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:8762)
    at s.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:134:7565)
    at c.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at c.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at m.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:14010)
    at s.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:7902)
    at c.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at c.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at m.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:14010)
    at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:6182)
    at MessagePortMain.emit (node:events:513:28)
    at MessagePortMain.emit (node:domain:489:12)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)

the extension host log is filled with these messages; they are continuously logged, and can occur a few times each second. 😬

here's the log file, grepped for the [error] TypeError: Cannot read properties of undefined (reading 'document') message:

2023-10-21 17:19:34.187 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:34.706 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:35.216 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:35.710 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:36.225 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:36.733 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:37.219 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:37.739 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:38.286 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:38.784 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:39.280 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:39.797 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:40.294 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:40.796 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:41.308 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:41.815 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:42.315 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:42.817 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:43.325 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:43.828 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:44.338 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:44.834 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:45.338 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:45.845 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:46.355 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:46.851 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:47.353 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:47.861 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:48.373 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:48.874 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:49.376 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:49.885 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:50.452 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:50.898 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:51.406 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:51.913 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:52.414 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:52.921 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:53.427 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:53.933 [error] TypeError: Cannot read properties of undefined (reading 'document')
2023-10-21 17:19:54.441 [error] TypeError: Cannot read properties of undefined (reading 'document')

the messages appears to be logged when the window lacks an open document. 🤔 in other words, as soon as a document is opened, the logging stops. (FWIW, a diff view does not appear to count as a "document". only opening a real file on disk will stop the logging.)

the logging will restart at some point after closing the document. it's not totally clear what triggers it. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants