UniqueVision / plpgsql-lsp

MIT License
51 stars 11 forks source link

Server crashes with ERR_INVALID_ARG_TYPE #43

Closed a-mckinley closed 2 years ago

a-mckinley commented 2 years ago

Describe the bug

I am unable to easily determine what SQL code is causing this issue as there is no context in the error message.

The error message before the server crash is:

node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at bidirectionalIndexOf (node:buffer:954:9)
    at Uint8Array.indexOf (node:buffer:960:10)
    at t.findIndexFromBuffer (/home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:42:8458)
    at l (/home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:1:10168)
    at /home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:1:11961
    at Array.flatMap (<anonymous>)
    at t.parseCreateStatements (/home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:1:11321)
    at t.parseDefinitions (/home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:30:996)
    at async t.DefinitionsManager.innerUpdateDocumentDefinitions (/home/alastair/.vscode/extensions/uniquevision.vscode-plpgsql-lsp-2.7.2-linux-x64/server/out/server.js:24:2916) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Environment

yas7010uv commented 2 years ago

@a-mckinley Sorry for the delay in noticing.

We will investigate the cause.

a-mckinley commented 2 years ago

FYI I am using PG14

yas7010uv commented 2 years ago

@a-mckinley Today we release v2.8.2, enhancing the error log message. This release does not resolve parse errors, please tell us your unparsed code sample.

a-mckinley commented 2 years ago

At first glance it appears that this error is gone in v2.8.2.

yas7010uv commented 2 years ago

That's good! Close this issue once.