GoogleContainerTools / GoogleContainerTools/skaffold

skaffold debug not working with yarn2 and nestjs

Open
#8,142 1 comment 0 reactions 0 assignees View on GitHub
area/debug kind/feature-request priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

I'm having trouble configuring step debugging in my nestjs project using yarn2(pnp + zero install). After a little troubleshooting I was advised to open an issue here.

I already tried changing the entrypoint in the dockerfile to just `start` and setting the `WRAPPER_ENABLED=false` environment variable. It seems that yarn itself takes in the `NODE_OPTIONS : --inspect=0.0.0.0:9229` set by `skaffold debug` before passing it to the actual process.

### Expected behavior
when running skaffold debug, my breakpoints should be bound and hit
### Actual behavior
`Starting inspector on 0.0.0.0:9229 failed: address already in use` is displayed during startup and breakpoints cannot be bound
### Information

- Skaffold version: v1.39.2
- Operating system: Windows 10
- Installed via: Chocolatey
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta29
kind: Config
metadata:
name: test
build:
local:
push: false
concurrency: 0 #build as much parallel as possible
artifacts:
- image: test
context: .
docker:
dockerfile: docker/Dockerfile
target: devserver
sync:
manual:
- src: 'src/**/*'
dest: '.'
hooks:
before:
- command: ['sh', '-c', 'yarn install']
deploy:
kustomize:
paths:
- k8s/overlays/docker-desktop
kubeContext: docker-desktop
```

### Steps to reproduce the behavior

1. [a clonable repository with the sample skaffold project](https://github.com/Rankarusu/skaffold_yarn2_nestjs_debugging)
2. `skaffold debug`
3. try to set a breakpoint in vscode and send a GET-request to `test.dev.localhost`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.