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

LS crashes #270

Closed
sekunho opened this issue Jun 9, 2021 · 15 comments
Closed

LS crashes #270

sekunho opened this issue Jun 9, 2021 · 15 comments
Labels
bug Something isn't working

Comments

@sekunho
Copy link

sekunho commented Jun 9, 2021

Not sure if this is related with #77, but it crashes in the same manner. So I just opened a new issue.

  • NixOS 20.09
  • rescript-vscode 1.1.2

Steps to reproduce:

  • Adapted the rescript project template to have react (just like the docs mentioned)
  • Follow through the rescript & react guide, get error. LS breaks.

lib/bs/.compiler.log

#Start(1623216881255)
#Done(1623216881256)

Stack trace

/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418
            parsedDiagnostics[parsedDiagnostics.length - 1].content.push(line);
                                                            ^

TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418:61)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:535:32)
    at awfEmit (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:601:14)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:722:9
    at FSReqCallback.oncomplete (fs.js:184:5)
[Info  - 1:31:36 PM] Connection to server got closed. Server will restart.
(node:30320) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418:61)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:626:8)
    at NodeFsHandler._handleFile (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/lib/nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/lib/nodefs-handler.js:629:21)
(Use `code --trace-warnings ...` to show where the warning was created)
(node:30320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:30320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418
            parsedDiagnostics[parsedDiagnostics.length - 1].content.push(line);
                                                            ^

TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418:61)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:535:32)
    at awfEmit (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:601:14)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:722:9
    at FSReqCallback.oncomplete (fs.js:184:5)
[Info  - 1:31:49 PM] Connection to server got closed. Server will restart.
(node:30361) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:418:61)
    at /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/index.js:626:8)
    at NodeFsHandler._handleFile (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/lib/nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/node_modules/chokidar/lib/nodefs-handler.js:629:21)
(Use `code --trace-warnings ...` to show where the warning was created)
(node:30361) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:30361) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
child_process.js:646
    throw err;
    ^

<ref *1> Error: spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe ENOENT
    at Object.spawnSync (internal/child_process.js:1067:20)
    at spawnSync (child_process.js:611:24)
    at Object.execFileSync (child_process.js:638:15)
    at Object.func (electron/js2c/asar_bundle.js:5:1846)
    at Object.runAnalysisAfterSanityCheck (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:147:31)
    at Object.runAnalysisCommand (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:154:26)
    at completion (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:288:26)
    at process.onMessage (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:587:18)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:903:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  path: '/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  spawnargs: [
    'completion',
    '/home/sekun/Projects/rescript-project-template/src/Test.res',
    3,
    1,
    '/run/user/1000/rescript_format_file_30361_0'
  ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 30401,
  stdout: null,
  stderr: null
}
[Info  - 1:32:22 PM] Connection to server got closed. Server will restart.
[Error - 1:32:22 PM] Request textDocument/completion failed.
Error: Connection got disposed.
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
child_process.js:646
    throw err;
    ^

<ref *1> Error: spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe ENOENT
    at Object.spawnSync (internal/child_process.js:1067:20)
    at spawnSync (child_process.js:611:24)
    at Object.execFileSync (child_process.js:638:15)
    at Object.func (electron/js2c/asar_bundle.js:5:1846)
    at Object.runAnalysisAfterSanityCheck (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:147:31)
    at Object.runAnalysisCommand (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:154:26)
    at completion (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:288:26)
    at process.onMessage (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:587:18)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:903:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  path: '/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  spawnargs: [
    'completion',
    '/home/sekun/Projects/rescript-project-template/src/Test.res',
    3,
    3,
    '/run/user/1000/rescript_format_file_30402_0'
  ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 30415,
  stdout: null,
  stderr: null
}
[Info  - 1:32:22 PM] Connection to server got closed. Server will restart.
[Error - 1:32:22 PM] Request textDocument/completion failed.
Error: Connection got disposed.
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
child_process.js:646
    throw err;
    ^

<ref *1> Error: spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe ENOENT
    at Object.spawnSync (internal/child_process.js:1067:20)
    at spawnSync (child_process.js:611:24)
    at Object.execFileSync (child_process.js:638:15)
    at Object.func (electron/js2c/asar_bundle.js:5:1846)
    at Object.runAnalysisAfterSanityCheck (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:147:31)
    at Object.runAnalysisCommand (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:154:26)
    at completion (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:288:26)
    at process.onMessage (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:587:18)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:903:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  path: '/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  spawnargs: [
    'completion',
    '/home/sekun/Projects/rescript-project-template/src/Test.res',
    3,
    5,
    '/run/user/1000/rescript_format_file_30416_0'
  ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 30431,
  stdout: null,
  stderr: null
}
[Error - 1:32:23 PM] Connection to server got closed. Server will not be restarted.
[Error - 1:32:23 PM] Request textDocument/completion failed.
Error: Connection got disposed.
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
@cristianoc
Copy link
Collaborator

@hsek thanks for the report!
Did you get any build error at all, or was it just the editor that was crashing?

Also, how was the build started? Within the editor or from the command line?

@sekunho
Copy link
Author

sekunho commented Jun 9, 2021

I had npm run start running in the terminal. The crashing came from the editor's output log.

image

Basically I was following along the docs and when I hit save, that's when the output log popped up with the stack trace.

Edit: I also get a similar error when opening this. Maybe it's a NixOS thing? Other language servers like the Elixir LS, or even HLS seem to work just fine though.

@cristianoc
Copy link
Collaborator

@hsek it could be a NixOS thing, though it's unclear why parsing fails, if the file lib/bs/.compiler.log is indeed what is pasted above in this issue.

@cristianoc
Copy link
Collaborator

cristianoc commented Jun 9, 2021

So the error is here:

      // part of the actual diagnostics message
      parsedDiagnostics[parsedDiagnostics.length - 1].content.push(

which I guess is only possible if parsedDiagnostics is empty.

@cristianoc
Copy link
Collaborator

Can't see how line.startsWith(" ") and the above lib/bs/.compiler.log can be true at the same time.

@cristianoc
Copy link
Collaborator

@hsek I think we're pretty close to the actual issue, but we need the correct version of lib/bs/.compiler.log that triggers it.

@cristianoc cristianoc added the bug Something isn't working label Jun 9, 2021
@sekunho
Copy link
Author

sekunho commented Jun 9, 2021

Sorry for the late response, and thanks for taking a look into this.

I tried redoing it since it might have been because I had succeeding saves, which prolly triggered something in the LS. I'm not too familiar with the process. I closed the editor, re-ran it, opened Test.res. VSCode reported an error with the language server through a notification, and I clicked the view output log. The error this time doesn't seem to include the parsedDiagnostics from the earlier message. Didn't touch anything else from here. I recorded it in hopes that it'll provide more information. Sorry, I'm pretty terrible at explaining.

2021-06-09.17-17-53.mp4
#Start(1623217700846)
#Done(1623217700846)
child_process.js:646
    throw err;
    ^

<ref *1> Error: spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe ENOENT
    at Object.spawnSync (internal/child_process.js:1067:20)
    at spawnSync (child_process.js:611:24)
    at Object.execFileSync (child_process.js:638:15)
    at Object.func (electron/js2c/asar_bundle.js:5:1846)
    at Object.runAnalysisAfterSanityCheck (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:147:31)
    at Object.runAnalysisCommand (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/utils.js:154:26)
    at definition (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:230:26)
    at process.onMessage (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/out/server.js:575:18)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:903:12) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  path: '/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe',
  spawnargs: [
    'definition',
    '/home/sekun/Projects/rescript-project-template/src/Test.res',
    14,
    44
  ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 8513,
  stdout: null,
  stderr: null
}
[Info  - 5:18:08 PM] Connection to server got closed. Server will restart.
[Error - 5:18:08 PM] Request textDocument/definition failed.
Error: Connection got disposed.
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

I'm not sure how to replicate the previous one tbh. Initially thought I just had to scroll up but that's the highest it can go.

@cristianoc
Copy link
Collaborator

cristianoc commented Jun 9, 2021

@hsek

This indicates an error in running the underlying executable.
Can you try the analogue of what I do below, but for your architecture?

% find ~/.vscode/extensions/chenglou92.rescript-vscode-1.1.2 -name "*.exe"
/Users/cristianoc/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe
/Users/cristianoc/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/darwin/rescript-editor-analysis.exe
/Users/cristianoc/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/win32/rescript-editor-analysis.exe


% /Users/cristianoc/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/darwin/rescript-editor-analysis.exe -help

@sekunho
Copy link
Author

sekunho commented Jun 9, 2021

$ find ~/.vscode/extensions/chenglou92.rescript-vscode-1.1.2 -name "*.exe"
/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe
/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/darwin/rescript-editor-analysis.exe
/home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/win32/rescript-editor-analysis.exe

$ /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe -help
bash: /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe: No such file or directory

$ . /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe
bash: .: /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux/rescript-editor-analysis.exe: cannot execute binary file

I double checked if the executable exists, and it does.

$ ls -la /home/sekun/.vscode/extensions/chenglou92.rescript-vscode-1.1.2/server/analysis_binaries/linux
total 11460
drwxr-xr-x 2 sekun users     4096 Jun  8 14:49 .
drwxr-xr-x 5 sekun users     4096 Jun  8 14:49 ..
-rwxr-xr-x 1 sekun users 11724712 Jun  8 14:49 rescript-editor-analysis.exe

@cristianoc
Copy link
Collaborator

OK the most likely issue is NixOs not happy with the prebuilt linux executable.
I would not know how to debug that, other than trying to building the extension yourself under NixOs.

@sekunho
Copy link
Author

sekunho commented Jun 9, 2021

Gotcha, I'll try it out with Pop OS and I'll report my findings. Thank you for your time.

@sekunho sekunho closed this as completed Jun 9, 2021
@MaxSvargal-imhio
Copy link

Hi folks! Have the same problem but on Mac OS

Language server:

(node:3776) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:409:61)
    at /Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:626:8)
    at FsEventsHandler.emitAdd (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/fsevents-handler.js:420:14)
    at FsEventsHandler._addToFsEvents (/Users/maxsvargal/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/fsevents-handler.js:495:12)
(Use `Code Helper (Renderer) --trace-warnings ...` to show where the warning was created)
(node:3776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

.compiler.log

#Start(1632569268816)
  Project root: /Users/maxsvargal/Documents/Projects/rescript-project-template
  Config language:typescript module:es6 importPath: shims:0 entries bsVersion:9.1.4
#Done(1632569268876)

@dlip
Copy link

dlip commented Oct 28, 2021

I added a NixOS package in this PR NixOS/nixpkgs#140433

@tsnobip
Copy link
Contributor

tsnobip commented Dec 2, 2021

same error happening to me when starting a build from the extension:

TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at awfEmit (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:601:14)
    at /Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:722:9
    at FSReqCallback.oncomplete (fs.js:184:5)
[Info  - 4:03:13 PM] Connection to server got closed. Server will restart.
(node:79296) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:626:8)
    at FsEventsHandler.emitAdd (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/fsevents-handler.js:420:14)
    at FsEventsHandler._addToFsEvents (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/fsevents-handler.js:495:12)
(Use `Code Helper (Renderer) --trace-warnings ...` to show where the warning was created)
(node:79296) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:79296) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418
            parsedDiagnostics[parsedDiagnostics.length - 1].content.push(line);
                                                            ^

TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at awfEmit (/Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:601:14)
    at /Users/paul/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:722:9
    at FSReqCallback.oncomplete (fs.js:184:5)
[Error - 4:03:27 PM] Connection to server got closed. Server will not be restarted.

in .compiler.log:

#Start(1638457407394)
File "/Users/paul/code/dialo/dialomorphic/src/serializers_user_fns_common.ml", line 45, characters 11-61:
Error: Unbound module Serializers_upgrader_t.From_202107291_to_202111111
#Done(1638457407446)

@osiire
Copy link

osiire commented Jan 4, 2022

same error happening to me.
this is not executable problem because my rescript-editor-analysis.exe runs normally in my env.
Are there any other possible causes?

(node:819735) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:626:8)
    at NodeFsHandler._handleFile (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/nodefs-handler.js:629:21)
(Use `code --trace-warnings ...` to show where the warning was created)
(node:819735) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:819735) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418
            parsedDiagnostics[parsedDiagnostics.length - 1].content.push(line);
                                                            ^

TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at awfEmit (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:601:14)
    at /home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:722:9
    at FSReqCallback.oncomplete (fs.js:184:5)
[Info  - 2:48:04 PM] Connection to server got closed. Server will restart.
(node:820461) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
    at Object.parseCompilerLogOutput (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/utils.js:418:61)
    at /home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:54:54
    at Map.forEach (<anonymous>)
    at sendUpdatedDiagnostics (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:52:19)
    at FSWatcher.<anonymous> (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/out/server.js:115:5)
    at FSWatcher.emit (events.js:315:20)
    at FSWatcher.emitWithAll (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:535:32)
    at FSWatcher._emit (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/index.js:626:8)
    at NodeFsHandler._handleFile (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (/home/osiire/.vscode/extensions/chenglou92.rescript-vscode-1.1.3/server/node_modules/chokidar/lib/nodefs-handler.js:629:21)
(Use `code --trace-warnings ...` to show where the warning was created)

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

6 participants