Configure vscode launch configuration to debug on cloud-run emulator using typescript

1k Views Asked by At

I am trying to debug a google-cloud-run application on the cloud run emulator. The application is written in typescript. ZI can run and debug the application locally and it stop properly on breakpoints. However, when I try to debug on the cloud emulator it ignore or grays out my breakpoints.

I am trying this on vscode, the launch.json follows:

            "name": "Cloud Run: Run/Debug Locally",
            "type": "cloudcode.cloudrun",
            "request": "launch",
            "build": {
                "docker": {
                    "path": "Dockerfile"
                }
            },
            "image": "get-num-partitions",
            "service": {
                "name": "get-num-partitions",
                "containerPort": 8080,
                "resources": {
                    "limits": {
                        "memory": "256Mi"
                    }
                }
            },
            "target": {
                "minikube": {}
            },
            "watch": true,
            "debug": {}
        }

Again the application runs, and I can see the debugger attaching, it just wont respect breakpoints.

1

There are 1 best solutions below

3
On

Agree with what @Leuofirdia mentioned. There is separate extension offered by GCP called Cloud Code Plugin that does what you are looking for.