Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's no run or debug option to debug app in container #5794

Closed
ryan6416 opened this issue Oct 27, 2021 · 14 comments
Closed

There's no run or debug option to debug app in container #5794

ryan6416 opened this issue Oct 27, 2021 · 14 comments
Assignees
Labels
debug info-needed Issue requires more information from poster

Comments

@ryan6416
Copy link

Issue Type: Bug

Open Remote - Containers
Select Try a Development Container Sample
Select Node
Navigate to "Run and Debug" and is empty

Extension version: 0.203.0
VS Code version: Code - Insiders 1.62.0-insider (0f7f6e338a4e86306474d4d01bdea9b8fe798017, 2021-10-27T05:15:08.811Z)
OS version: Darwin arm64 20.6.0
Restricted Mode: No
Remote OS version: Linux arm64 5.10.47-linuxkit

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 2
Memory (System) 16.00GB (0.11GB free)
Process Argv --crash-reporter-id f1bfd64f-cc52-4aa7-9bd5-ab82475bf95f --crash-reporter-id f1bfd64f-cc52-4aa7-9bd5-ab82475bf95f
Screen Reader no
VM 0%
Item Value
Remote Dev Container: Node.js
OS Linux arm64 5.10.47-linuxkit
CPUs unknown (4 x 0)
Memory (System) 1.93GB (0.06GB free)
VM 0%
@github-actions github-actions bot added the containers Issue in vscode-remote containers label Oct 27, 2021
@chrmarti
Copy link
Contributor

I have Launch Program next to the green arrow for launching the sample server. Could you attach a screenshot?

@chrmarti chrmarti self-assigned this Oct 28, 2021
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Oct 28, 2021
@ryan6416
Copy link
Author

ryan6416 commented Oct 28, 2021

@chrmarti in the dev container:
image

in my local:
image

@ryan6416
Copy link
Author

.vscode/launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/server.js"
        },
    ]
}

.devcontainer/devcontainer.json

{
	"name": "Node.js",
	"build": {
		"dockerfile": "Dockerfile",
		"args": { "VARIANT": "16-bullseye" }
	},
	"settings": {},
	"extensions": [
		"dbaeumer.vscode-eslint"
	],
	"portsAttributes": {
		"3000": {
			"label": "Hello Remote World",
			"onAutoForward": "notify"
		}
	},
	"postCreateCommand": "yarn install",
	// "remoteUser": "node"
}

.devcontainer/Dockerfile

ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

@chrmarti
Copy link
Contributor

@weinand The debug UI seems to be missing the drop-down for launching.

@chrmarti chrmarti removed containers Issue in vscode-remote containers info-needed Issue requires more information from poster labels Oct 29, 2021
@chrmarti chrmarti assigned weinand and unassigned chrmarti Oct 29, 2021
@Cecilia-Sensalari
Copy link

Hi, I have the same problem when opening VSC in remote through SSH. Killing the processes and deleting .vscode-server did not solve the issue.

@weinand
Copy link

weinand commented Nov 3, 2021

I'm investigating...

@weinand
Copy link

weinand commented Nov 4, 2021

The empty "Run and Debug" is an indication that no debugger extension is available in the dev container. Since VS Code comes with the built-in debugger "js-debug", this situation should not really occur...
Could it be that your "js-debug" is disabled?
Please open the Extensions viewlet and enter "js-debug" in the filter box.
A grayed-out JavaScript Debugger is disabled. Please enable it...

2021-11-04_16-40-02

@weinand weinand added the info-needed Issue requires more information from poster label Nov 4, 2021
@Cecilia-Sensalari
Copy link

Hi,
Thanks a lot for looking into this!
The extension is already enabled:
image
I discovered that my VS code is not detecting an interpreter (in my case Python), could it be that this is causing problems in setting up the debug interface?

@weinand
Copy link

weinand commented Nov 4, 2021

@Cecilia-Sensalari I don't think so. VS Code does not know anything about interpreters. So a missing Python interpreter is not detected by VS Code. Only the Python extension would be able to detect this...

But is the Python extension(s) correctly enabled in the dev container?
They should show up in the "DEV CONTAINER ... INSTALLED" section:

2021-11-04_17-10-40

@ryan6416
Copy link
Author

ryan6416 commented Nov 5, 2021

@weinand yea in my case I had disabled the built-in javascript debugger and installed a nightly version below:

image

After enabling the built-in one, I see the debug options. Thanks!

@weinand
Copy link

weinand commented Nov 9, 2021

My analysis:
If js-debug is disabled locally (because js-debug-nightly has been installed), opening the workspace remotely (e.g. in a Docker container) will not automatically install js-debug-nightly in the remote. As a consequence, no enabled debug extension will be available which results in the situation described in this issue.

I see two options for addressing this:

  • js-debug-nightly will be installed automatically in the remote to faithfully mimic the behavior of the built-in js-debug.
  • js-debug-nightly is not automatically installed but we try to make clear what the problem is by showing this message in the "Run and Debug" viewlet:
    2021-11-09_18-15-19
    (the second option has already been implemented in the latest Insiders)

@connor4312 @roblourens @sandy081 opinions?

@weinand weinand added the debug label Nov 9, 2021
@sandy081
Copy link
Member

If js-debug is disabled locally (because js-debug-nightly has been installed),

This is because js-debug and js-debug-nightly are two different extensions mainly to have insiders support for the extension. We are planning to support insiders extension in VS Code through one extension. I am assuming this might fixes it. But, there is a catch here that js-debug is a built-in extension and we do not support updating built in extensions and we have to think how to support this.

CC @isidorn

@isidorn
Copy link

isidorn commented Nov 11, 2021

After discussing with @sandy081 we have decided that enabling built-in extensions to on-board to the insiders extension story will only be possible once we start supporting updating built-in extensions out of band.
Here's an issue tracking this microsoft/vscode#68410

@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

6 participants