cannot read properties of undefined
Samrose-Ahmed opened this issue · comments
I'm getting this error trying to use with trinosql:
TypeError: Cannot read properties of undefined (reading 'get')
at _CodeCompletionCore.collectCandidates (http://localhost:3000/trinosql.worker.js:68773:33)
at TrinoSQL.getSuggestionAtCaretPosition (http://localhost:3000/trinosql.worker.js:50222:29)
at TrinoSQLWorker.<anonymous> (http://localhost:3000/trinosql.worker.js:63071:41)
at Generator.next (<anonymous>)
at http://localhost:3000/trinosql.worker.js:63030:67
at new Promise (<anonymous>)
at __awaiter (http://localhost:3000/trinosql.worker.js:63012:10)
at TrinoSQLWorker.doComplete (http://localhost:3000/trinosql.worker.js:63068:12)
at EditorSimpleWorker.fmr (http://localhost:3000/trinosql.worker.js:61720:58)
at SimpleWorkerServer._handleMessage (http://localhost:3000/trinosql.worker.js:58454:59)
Seems to be throwing here https://github.com/DTStack/dt-sql-parser/blob/55379f3cf5a88ae7682d2a9d1a08a509e73c1263/src/parser/common/basicParser.ts#L330 inside https://github.com/mike-lischke/antlr4-c3/blob/705a1dadda76c4700f3b7a992be63ddf1ffe1792/src/CodeCompletionCore.ts#L182 because the tokenStream is undefined.
Please provide the SQL content and the version you have installed, so that we can fix the problem more quickly.
This is on the latest version and happens with any content from single character to full sql string
I tried changing to a few versions earlier and the issue is there as well
This problem should be caused by the version update of antlr4-c3. See this issue . If the version of antlr4-c3 in the node_modules is above 3.2.x, you can confirm that this issue is causing it. We will release a new version as soon as possible to fix this issue.
Thanks much for the update. I can confirm the antlr4-c3 version is 3.3.4
. I will try overriding it now.
can confirm it works by downgrading to 3.1.1
Refer to DTStack/dt-sql-parser#206.
@Samrose-Ahmed
Sorry for the trouble!
Now the new version v0.12.0-beta.6
has been released. If you confirm that your issue has been resolved, please close this issue, or we will close it in a week.
I can confirm issue is resolved thanks.