Skip to content

Module debugging

Julian Waller edited this page Feb 6, 2025 · 1 revision

While developing a module, there are a couple of approaches you can take to debugging.

Debug logging

You can open a module specific log view here:

Connection debug log

This will show only messages logged from your module, including any console.log() and similar calls, as well as a few system messages to report the module start/stop

Attach Debugger

Sometimes it can be useful to attach a debugger to your module for some in depth debugging.

If you create a file DEBUG-INSPECT in the root of your module folder, companion will launch your module with the remote debugging protocol enabled.

You can use any compatible debugger such as the builtin vscode debugger, or chrome inspector to connect to this.

By default it will pick and use a random port that will change each launch, you can specify a port number inside the DEBUG-INSPECT file to use a fixed port for debugging.

It may not not possible to debug the init method from your module with this, Companion still imposes the same launch timeout as usual here. But you can attach after this and see what is going on.

Clone this wiki locally