exhibitionist-digital / ultra

Zero-Legacy Deno/React Suspense SSR Framework
https://ultrajs.dev
MIT License
2.99k stars 65 forks source link

How to debug with VSCode? #295

Open d9k opened 6 months ago

d9k commented 6 months ago

How to debug the server side of project based on Ultra using VSCode?

.vscode/launch.json:

{
    {
      "name": "dev server (deno)",
      "request": "launch",
      "type": "pwa-node",
      "program": "${workspaceFolder}/server.tsx",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "${env:HOME}/.deno/bin/deno",
      "env": {
        "ULTRA_LOG_LEVEL": "DEBUG"
      },
      "runtimeArgs": [
        "run",
        "--no-npm",
        "--unstable",
        "--inspect-wait",
        "--allow-all"
      ],
      "args": [],
      "attachSimplePort": 9229
    }
}

Result:

Debugger listening on ws://127.0.0.1:9229/ws/1d32b196-31f2-4e90-ae21-8aab58a33d45
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
Debugger session started.
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
    at eventLoopTick (ext:core/01_core.js:178:11)
Process exited with code 

Tried "runtimeArgs": "--inspect" instead of "--inspect-wait", same result. "type": "pwa-node" instead of "node", same result.