MASON MARK (.COM)

debug your Deno programs with VS Code Part III โ€” RETURN OF THE FUCKERY ๐Ÿ’€

2020-07-19

UPDATE: Since this was posted, in the course of filing a bug report for this issue, I learned of a better workaround and included it as #0 below.

Further good news is that a fix is coming โ€” this issue is already fixed in the nightly builds of vs-code-js-debugger. If you are OK with using a nightly build, you can follow the instructions in this comment by vs-code-js-debugger maintainer conor4312 to solve the problem until an updated version of the debugger is officially released.

VS Code 1.47 (June 2020) breaks the convenient Deno debugging that was previously described here, in "debug your Deno programs with VS Code โ€” NOW WITH LESS FUCKERY!!!"

The technique described therein works with VS Code 1.46 (and previous), but no longer works in 1.47.

the FUCKERY and DEBAUCHED DEBUGGERY is BACK ๐Ÿ˜ฉ

the FUCKERY is BACK ๐Ÿ˜ฉ

Workaround 0: Disable the debug.javascript.usePreview setting in VS Code. This will re-enable the old debugger which doesn't exhibit this problem.

Workaround 1: Use the shitty-but-working debugging technique described in this newspaper's original Deno debugging article from April 2020, "debug your Deno programs with VS Code". That requires two steps: launch the debugger, then quickly start your Deno program manually on the command line (with the --inspect-brk argument) before the debugger times out.

Workaround 2: Install the last working version of VS Code, from the VS Code May 2020 (version 1.46) release page. (Note that you can name this version "VS Code โ€” Dope Deno Debug 'Dition" and install it along side the latest release โ€” although it does seem that multiple different versions of VS Code cannot run simultaneously without waging horrific and total war against each other.)

more details

Given an identical debug configuration entry like this:

{
  "version": "0.2.0",
  "configurations": [
    {
      "console": "integratedTerminal",
      "name": "Debug Deno (Allow All)",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "deno",
      "runtimeArgs": ["run", "--inspect-brk", "-A", "${file}"],
      "port": 9229
     }
  ]
}

...VS Code 1.46 emits a command like this in the terminal when you hit F5:

cd /Users/mason/Documents/Syncthing/CODE/deno-fuckery ; /Users/mason/.local/bin/deno run --inspect-brk -A /Users/mason/Documents/Syncthing/CODE/deno-fuckery/main.ts

That looks right, and does work.

But in VS Code 1.47 the emitted command is:

env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code-LATEST.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" ' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/_m/p_1dc3dj3mv12hr0nl1s1chh0000gn/T/node-cdp.13593-1.sock","deferredMode":false,"waitForDebugger":"","execPath":"/Users/mason/.nodenv/shims/node","onlyEntrypoint":false,"fileCallback":"/var/folders/_m/p_1dc3dj3mv12hr0nl1s1chh0000gn/T/node-debug-callback-b6731a1c153c29aa"}' /Users/mason/.local/bin/deno run -A /Users/mason/Documents/Syncthing/CODE/deno-fuckery/main.ts

Now that decidedly does not look right. Not for the purposes of debugging a Deno program, anyway. Where did our magic incantation --inspect-brk go? The --inspect-brk is getting somehow swallowed and not passed on to Deno. Without that, Deno isn't going to pause for us and engage the debugger.

I suspect, but haven't yet proved, that this is related to the "new JS debugger" feature of VS Code 1.47.

KEYWORDS: Deno, VS Code, VS Code 1.47 breaks debugging, debug, debugger, TypeScript, --inspect, --inspect-brk, lack of childcare can and does make good people insane, Trump is a traitorous pedo-adjacent mentally-diseased racist incest-fantasist and malevolent lardassed idiot who didn't cause but merely exacerbated and perfectly exemplifies the decline and fall of the USA and even if the county does somehow recover against all odds from the present degenerate era and redeem itself as a high-functioning democracy the hole is so deep that every person on earth who is alive right now will already be dead by the time that happens

PREVIOUSLY:

2012-11-14
Version 2.0a1
2012-03-16
QRWTF
2011-12-31
UFC 141 Predictions
2011-12-05
The Xcode Fairy
2011-11-11
mail fail
2011-10-12
NIGGERHEAD
2011-10-12
tasty Tokyo tacos
2011-08-10
DRM clusterfuck
2011-06-14
9 lifetimes
2011-03-09
Dear Rubymine
2010-12-25
MERRY ATHEISTMAS!
2010-11-03
cutting boards
2010-09-15
REDACTED
2010-08-25
HELLO, KPCHNZ
2010-05-15
Never Surrender
2010-04-18
stop the insanity
2010-04-18
I like my new phone
2010-01-13
caution: snakes
2010-01-09
โ™ฌโ™ฉ
2009-03-25
'TARD FIGHT!!!!
2008-11-23
34 ways to die*
2008-11-05
yes, we did
2008-10-25
si, se puede
2008-08-20
If it *is* Biden...
2008-05-12
2.0
2008-04-08
blink faster
2008-03-21
๐Ÿ“• Red Mars
2008-01-29
vote
1979-11-20
new gun