JavaScript debugging tips

wh debug - Various global and JS/TS debugging tools

wh harescript-debug - Legacy HareScipt debug tool

Make sure to enable Developer options in your WebHare personal settings. This will enable various debug applications.

Use all debugging tools at your own risk - debugging may pause or crash important processes, which in turn may affect other processes, webpages or scripts. Do not debug in production unless you absolutely have to.

Chrome Developer tools

We recommend the 'node debugger' application in WebHare to list running JavaScript processes and start the Chrome tools on a specific worker. This will launch a hosted version of the Devtools and offer it a websocket proxy to connect back to the debugged proces. Do not share these tools or the websocket URL with anyone - it gives them effective full sysop access to the server.

If the node debugger fails to work, you can use Chrome's developer tools to debug JavaScript/TypeScript applications:

We recommend using Canary as eg. memory profiling seems to work better than in normal Chrome.

Live debugging

WebHare node processes offer a $wh object with access to useful APIs/objects inside a running process

You can modify the debugflags of a running process by setting $wh.debugFlags