Closed ziontee113 closed 10 months ago
Turns out I can also use console.warn
, which won't produce the channel errors and crash the plugin.
If
console.log()
gets ran in my code, it will work the first time, then the second time it will throwE475: Invalid argument: Channel doesn't exist
stdout is used for the RPC channel, so writing to it will break the channel which only accepts msgpack-rpc.
Turns out I can also use
console.warn
, which won't produce the channel errors and crash the plugin.
presumably, that writes to stderr instead of stdout
Thank you @justinmk for explaining. However I'm confused due to the example is using console.log
here https://github.com/neovim/node-client/blob/master/examples/decorators.md
Should I not use console.log
at all while developing plugin using Javascript? Thank you.
the example is using
console.log
here https://github.com/neovim/node-client/blob/master/examples/decorators.md
That doc should be fixed, would you mind sending a PR? Either console.error
or possibly process.stderr.write()
should be better.
Hi. I run into channel related issues whenever I use any type
console.log()
.If
console.log()
gets ran in my code, it will work the first time, then the second time it will throwE475: Invalid argument: Channel doesn't exist
Also logging doesn't work for me. It does create a log file but doesn't write anything into it.
The ONLY way that I can log stuffs is to use
console.error()
. Anything else likeconsole.info
,console.debug
, etc... will be met with`E475: Invalid argument: Channel doesn't exist
orInvalid Channel
error.I'm currently using the Devtool to see the console output.