Unable to load language for file
Before submitting your bug report
- [x] I believe this is a bug. I'll try to join the Continue Discord for questions
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Ubuntu
- Continue: 0.5
- IDE: Jetbrain
Description
I got following error in core.log randomly while using Tab Autocomplete: Unable to load language for file index.vue TypeError: Cannot read properties of undefined (reading 'apply')
To reproduce
I'm using LM Studio Server I'd test following models: codeqwen-1.5-7b-Chat CodeLlama-7B-instruct Meta-llama-8b-instruct StarCoder2-3b
Log output
[2024-06-11 00:26:04.952] [INFO] [LM STUDIO SERVER] Processing... [2024-06-11 00:26:08.253] [INFO] [LM STUDIO SERVER] First token generated. Continuing to stream response.. [2024-06-11 00:26:08.254] [INFO] [LM STUDIO SERVER] Client disconnected. Stopping generation.. [2024-06-11 00:26:08.254] [INFO] [LM STUDIO SERVER] Finished streaming response [2024-06-11 00:26:08.254] [INFO] [LM STUDIO SERVER] Finished streaming response [2024-06-11 00:26:08.255] [INFO] [LM STUDIO SERVER] Finished streaming response [2024-06-11 00:26:08.255] [INFO] [LM STUDIO SERVER] Finished streaming response [2024-06-11 00:26:08.418] [INFO] [LM STUDIO SERVER] Finished streaming response
@mmta41 it looks like this might be a problem with the vue parser that we use for tree-sitter. Do you see this only in Vue files?
I'm seeing thousands of those in #1535
@mmta41 is there a work around for this? Is there some kind of language setting? I don't think any of my project files were indexed because of this.
Here is the log for one file in my git project: RevolveGenerator.cs.
console.ts:137 [Extension Host] Chunk with more than 500 tokens constructed: c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs 1922
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
console.ts:137 [Extension Host] Chunk with more than 500 tokens constructed: c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs 2142
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
log.ts:439 ERR [Extension Host] Unable to load language for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs RuntimeError: table index is out of bounds
at wasm://wasm/000b54aa:wasm-function[237]:0x29e6a
at _Parser.initialize (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:39356:19)
at new _Parser (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:38279:16)
at getParserForFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:40132:20)
at async codeChunker (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79467:18)
at async chunkDocumentWithoutId (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79510:24)
at async chunkDocument (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79521:20)
at async _LanceDbIndex.computeChunks (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113710:28)
at async _LanceDbIndex.update (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113827:26)
at async CodebaseIndexer.refresh (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358192:47)
at async Core.refreshCodebaseIndex (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358992:26)
console.ts:137 [Extension Host] Unable to load language for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs RuntimeError: table index is out of bounds
at wasm://wasm/000b54aa:wasm-function[237]:0x29e6a
at _Parser.initialize (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:39356:19)
at new _Parser (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:38279:16)
at getParserForFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:40132:20)
at async codeChunker (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79467:18)
at async chunkDocumentWithoutId (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79510:24)
at async chunkDocument (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79521:20)
at async _LanceDbIndex.computeChunks (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113710:28)
at async _LanceDbIndex.update (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113827:26)
at async CodebaseIndexer.refresh (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358192:47)
at async Core.refreshCodebaseIndex (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358992:26)
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
console.ts:137 [Extension Host] Failed to load parser for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs:
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
log.ts:439 ERR [Extension Host] Unable to load language for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\SphereGenerators.cs RuntimeError: table index is out of bounds
at wasm://wasm/000b54aa:wasm-function[237]:0x29e6a
at _Parser.initialize (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:39356:19)
at new _Parser (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:38279:16)
at getParserForFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:40132:20)
at async codeChunker (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79467:18)
at async chunkDocumentWithoutId (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79510:24)
at async chunkDocument (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79521:20)
at async _LanceDbIndex.computeChunks (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113710:28)
at async _LanceDbIndex.update (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:113827:26)
at async CodebaseIndexer.refresh (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358192:47)
at async Core.refreshCodebaseIndex (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358992:26)
log.ts:439 ERR [Extension Host] Unable to load language for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs RuntimeError: table index is out of bounds
at wasm://wasm/000b54aa:wasm-function[237]:0x29e6a
at _Parser.initialize (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:39356:19)
at _Parser (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:38279:16)
at getParserForFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:40132:20)
at async CodeSnippetsCodebaseIndex.getSnippetsInFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79148:24)
at async CodeSnippetsCodebaseIndex.update (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79175:24)
at async CodebaseIndexer.refresh (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358192:47)
at async Core.refreshCodebaseIndex (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358992:26)
console.ts:137 [Extension Host] Unable to load language for file c:\src\UnityTestBed\Assets\Test\3rdParty\ViRGiS-Geometry\mesh_generators\RevolveGenerator.cs RuntimeError: table index is out of bounds
at wasm://wasm/000b54aa:wasm-function[237]:0x29e6a
at _Parser.initialize (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:39356:19)
at _Parser (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:38279:16)
at getParserForFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:40132:20)
at async CodeSnippetsCodebaseIndex.getSnippetsInFile (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79148:24)
at async CodeSnippetsCodebaseIndex.update (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:79175:24)
at async CodebaseIndexer.refresh (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358192:47)
at async Core.refreshCodebaseIndex (c:\Users\jstraub\.vscode\extensions\continue.continue-0.8.40-win32-x64\out\extension.js:358992:26)
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
Wow ok so maybe vue and c# are broken? The best way to test this would be to add *.cs to a .continueignore in the root of your repository and determine whether the errors completely stop
Encountering similar issue but for *.vue files.
It seems the WASM bindings don't exist in .continue directory as both tree-sitter and core/util/treeSitter.ts#L162 suggest they should?
To reproduce:
Run the following from continue/core with bun run
import { getParserForFile } from "./util/treeSitter";
import { writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import Parser from "web-tree-sitter";
const tempDir = tmpdir();
const tempFileName = `App.vue`;
const tempFilePath = join(tempDir, tempFileName);
const content = `<template>
<div>
<RouterView v-slot="{ Component }">
<component :is="Component" />
</RouterView>
</div>
</template>
<script setup lang="ts"></script>`;
async function test() {
// Generate a temporary .vue file
await writeFile(tempFilePath, content, 'utf-8');
// Attempt 1: Uses the implementation as is
try {
await getParserForFile(tempFilePath);
} catch (err) {
console.error(err);
}
// Attempt 2: Modifies the implementation using the existent binding from node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm
try {
await Parser.init();
// Try again with the existent WASM binding
const wasmPath = join(
__dirname,
"node_modules", "tree-sitter-wasms", "out",
`tree-sitter-vue.wasm`,
);
return await Parser.Language.load(wasmPath);
} catch (err) {
console.error(err);
}
}
test().catch(console.error);
Stack Trace:
~/.continue/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm
_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev
_Znwm
_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm
_ZdlPv
_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm
_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc
_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm
_ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv
_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm
Unable to load language for file src/App.vue 505 | }
506 | if (t in wasmImports && !wasmImports[t].stub) return wasmImports[t];
507 | console.log(t)
508 | var r;
509 | t in e || (e[t] = function () {
510 | return r || (r = resolveSymbol(t)), r.apply(null, arguments)
TypeError: undefined is not an object (evaluating 'r.apply')
at ~/.continue/node_modules/web-tree-sitter/tree-sitter.js:510:55
at WASM ([wasm code])
at WASM ([wasm code])
at postInstantiation (~/.continue/node_modules/web-tree-sitter/tree-sitter.js:536:52)
Related issue:
So continue.dev is unusable for a vue project ?
I am not sure how a closed issue https://github.com/tree-sitter/tree-sitter/issues/2610 is related to this ?
This will be fixed by https://github.com/Gregoor/tree-sitter-wasms/issues/47#issuecomment-2317185652
Thanks @stephane303 or looking into the problem! For now I've disabled .vue tree-sitter in Continue, which means that we can just fall back to other methods and most things should work just the same. Whenever that issue is solved we'll be able to test and hopefully bring it back
I ran into what looks to be the same problem:
[Extension Host] Error parsing /home/alex2/example.sh: TypeError: Cannot read properties of undefined (reading 'apply')
at e4.<computed> (/home/alex2/.vscode/extensions/continue.continue-0.8.66-linux-x64/out/extension.js:109650:63)
at wasm://wasm/0055765a:wasm-function[15]:0x29b5
at wasm://wasm/000b54aa:wasm-function[234]:0x25635
at _Parser.parse (/home/alex2/.vscode/extensions/continue.continue-0.8.66-linux-x64/out/extension.js:110323:30)
at CodeSnippetsCodebaseIndex.getSnippetsInFile (
<snip>
Tracking down the relevant line leads me to the function loadWebAssemblyModule
var r4;
t4 in e4 || (e4[t4] = function() {
return r4 || (r4 = resolveSymbol(t4)), r4.apply(null, arguments); <--- ERROR HERE
});
return e4[t4];
Looks like https://github.com/tree-sitter/tree-sitter-bash/issues/243 is the report against tree-sitter but I don't see where it is supposedly fixed
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
I think this is still relevant or has this been adressed e.g. by updating tree-sitter?
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!