vscode-parse-tree icon indicating copy to clipboard operation
vscode-parse-tree copied to clipboard

LanguageStillLoadingError: Language 'javascript' is still loading; please wait and try again

Open chfritz opened this issue 2 years ago • 7 comments

I'm using this extension inside of my sane-indentation extension and after upgrading vscode today to 1.71.1 I now get:

[Extension Host] LanguageStillLoadingError: Language 'javascript' is still loading; please wait and try again
	at getTreeForUri (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/out/extension.js:192:27)
	at getNodeAtLocation (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/out/extension.js:206:24)

Any idea where this is coming from and how to fix it? Do you need to publish a new version or did something break in your recent commits?

chfritz avatar Sep 15 '22 03:09 chfritz

Update: for some reason this is not happening in all my workspaces only in one, and I haven't yet figured out why there and nowhere else. But when I reload the window of that workspace I also noticed this error:

[Extension Host] stack trace: TypeError: Cannot read properties of undefined (reading 'apply')
	at e.<computed> (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:10533)
	at wasm://wasm/0005dc02:wasm-function[555]:0x14a0a
	at e.<computed> (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:10533)
	at wasm://wasm/0005dc02:wasm-function[531]:0x147a1
	at e.<computed> (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:10533)
	at wasm://wasm/0005dc02:wasm-function[515]:0x144ed
	at e.<computed> (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:10533)
	at wasm://wasm/0005dc02:wasm-function[366]:0x13533
	at wasm://wasm/000afe02:wasm-function[217]:0x245ba
	at Module._ts_parser_parse_wasm (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:20088)
	at Parser.parse (/home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/node_modules/web-tree-sitter/tree-sitter.js:1:35207)
	at /home/cfritz/.vscode/extensions/pokey.parse-tree-0.21.2/out/extension.js:93:43

chfritz avatar Sep 15 '22 03:09 chfritz

I think I've narrowed it down: the errors only occur when I have an HTML file open among my editors!

chfritz avatar Sep 15 '22 03:09 chfritz

Interesting! Maybe worth trying the tree-sitter cli with the tree-sitter-html parser on the html file to see if it hangs?

pokey avatar Sep 15 '22 08:09 pokey

I haven't tried that yet, but I've narrowed it down further: it only happens when the said html file is already open when the window (re-)loads and the HTML contains web components, aka. custom tags.

chfritz avatar Sep 15 '22 15:09 chfritz

Ah interesting! Do you have an example? I tried an html file with web components, and although it didn't parse correctly, it didn't seem to affect other documents in the workspace

pokey avatar Sep 16 '22 12:09 pokey

Here is the file. And as a reminder: after you've opened it, you need to do a "Developer: Reload Window" to trigger the bug.

<html>
<head>

</head>

<body>
  <script src="http://portal.homedesk.local:8000/running/@transitive-robotics/webrtc-video/dist/webrtc-video-device.js?userId=cfritz&deviceId=f5b1b62bd4"></script>
  <webrtc-video-device
  id="cfritz"
  host="homedesk.local:8000"
  ssl="false"
  text="/dev/video0"
  timeout="1800"
  source="/dev/video0"
  type="v4l2src"
  width="320"
  height="240"
  framerate="15/1"
  bitrate="20"
  />
</body>
</html>

chfritz avatar Sep 16 '22 14:09 chfritz

Caused by <webrtc-video-device ... />

For some reason it cannot handle tags that are over 10 chars long <abcdefghijk> will break it, but <abcdefghij> wont

RedCMD avatar Sep 21 '22 00:09 RedCMD

Fwiw here is the issue to track the >10 chars thing https://github.com/tree-sitter/tree-sitter-html/issues/30

pokey avatar Feb 07 '23 11:02 pokey

fixed by 6317e9198e38bdb478f44f16f5d2cc4ff3a80ad8

pokey avatar Dec 01 '23 15:12 pokey