0

I try to debug js with docker by vscode IDE vcode loss debugging - unbound after changed code

My visual code (.vscode) launch.json

{
"version": "0.2.0",
"configurations": [

  {
    "type": "node",
    "request": "attach",
    "name": "Debug: app-name",
    "remoteRoot": "/usr/src/app",
    "localRoot": "${workspaceFolder}",
    "protocol": "inspector",        
    "port": 9229,
    "restart": true,
    "address": "0.0.0.0",
    "skipFiles": ["<node_internals>/**"]
   }
  ]
 }
}

My Docker file

DockerFile

FROM node:12.13-alpine As development

WORKDIR /usr/src/app

COPY  package*.json ./

RUN npm install --only=development

COPY . .

RUN npm run build

package.json command

"start:debug": "nest start --debug 0.0.0.0:9229 --watch",

docker-compose

version: "3.8"
services:
resource:
    container_name: gate
    volumes:
        - .:/usr/src/app
        - /usr/src/app/node_modules
    build: 
        context: .
        target: development
    ports:
        - 3001:3000
        - 9229:9229
    command: npm run start:debug

networks:
  webnet:
volumes:
  pgdata:

unbound brakepoints

1 Answers1

0

I founded the problem, set debug.javascript.usePreview to false and my debugger works well.

https://github.com/microsoft/vscode/issues/102493

  • `debug.javascript.usePreview` is no longer available starting from VSCode 1.60.0. Check out options on how to use the legacy debugger in [This answer](https://stackoverflow.com/a/69122112/1044637) – sorjef Sep 09 '21 at 17:02