Meteor debug in VS Code with WSL

I need help setting up the debugging. I tried it many ways, and I am afraid my setup is not covered by any guide. I use Windows 10 and run meteor in WSL, while the VS Code and everything else sits on Windows.

Following the official cookbook got me only to the point where the server does not restart due to “parent process exited”. I could not sort that out and restarting the server manually is not a solution. There might be more problems down the road.

So I eventually decided just to “attach” the debugger from VS Code, which auto-attaches the debugger automatically on server reload and I can even breakpoint some parts of the code. Parts I cannot debug are e.g. server methods or packages. I blame sourcemaps, but have to idea how to map them. I experimented localRoot and remoteRoot to no avail. But when I added debugger to the code, it stopped at least (I could not step lines though, only continue running) and I noticed the “other” file (with path like \remote…\wsl…\mnt\c… that could get me breakpoints (to no avail again; that file cannot be opened unless it is somewhat magically opened during debugging).

So I gave up on VS Code and at least tried to use Chrome Node debugger. I was able to debug methods, but restarting waited for me to reload the debugger (annoying) and I could not hook into packages for some reason (code splitting? sourcemaps?).

After that I gave up completely. I may just try to run Meteor without WSL, but my experience was that the build times are much longer. But maybe debugging will start working finally.

{
      "name": "Attach to Process",
      "type": "node",
      "request": "attach",
      "restart": true,
      "protocol": "inspector",
      "sourceMaps": true,
      "port": 9229,
      // "outFiles": [
      //   "${workspaceRoot}/.meteor/local/build/programs/server/app/app.js"
      // ],
      // "localRoot": "${workspaceFolder}",
      // "remoteRoot": "/mnt/c/meteor/${workspaceFolderBasename}"
      // "remoteRoot": "\\vscode-remote:\\wsl%2Bdefault\\mnt\\c\\meteor\\slm-frontend"
      // "remoteRoot": "/mnt/c/meteor/slm-frontend"
      // "remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}"
    },

Has anyone made VS Code debugging with WSL working?