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

Using the debugger inside a devcontainer #345

Open
DerProfessor opened this issue Oct 18, 2023 · 1 comment
Open

Using the debugger inside a devcontainer #345

DerProfessor opened this issue Oct 18, 2023 · 1 comment
Labels

Comments

@DerProfessor
Copy link

Hi there,

I am trying to debug an issue inside my react app when using the Firefox browser. My app resides inside a devcontainer because my backend app is also residing there.

When I try to debug the issue and set a breakpoint the debugger stops apparently at the line. But the corresponding source file can't be open. This is kinda weird because when I use the Edge debugger extension for example everything is working fine. Also the path to file which can't be opened is valid inside the container. I checked that. The error message is:
The editor could not be opened because the file was not found.

This is my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch frontend (yarn)",
            "type": "node",
            "request": "launch",
            "runtimeExecutable": "yarn",
            "cwd": "${workspaceFolder}/interface",
            "runtimeArgs": ["start"],
            "console": "integratedTerminal"
        },
        {
            "type": "firefox",
            "request": "launch",
            "name": "Debug frontend in Firefox",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}/interface/",
        },
        {
            "type": "msedge",
            "request": "launch",
            "name": "Debug frontend in Edge",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}/interface/",
        }
   ]
}

I dug a little bit deeper and it seems that the debug extension is trying to open the file on my host environment which of course can't work because the layout is totally different. The Edge extension seem to open file inside the devcontainer just fine. Maybe the issue resides here?

Using vscode version: 1.83.1
Firefox extension version: v2.9.10
Firefox version: 118.0.2

Cheers
Daniel

@jota0222
Copy link

I have had this same problem too. if you enable it to stop in exceptions, for example, it says that the file doesn't exist because it tries to open it but in the host filesystem, not in the container filesystem, which makes me think the problem is that. this debugger somehow forces the breakpoints to be in the host.

My host is Linux Deepin and my container is Alpine, if I check the file opened this is the filesystem used, and there is no workspace folder:
imagen

While in the container these are the folders:
imagen

@nchevobbe nchevobbe added the bug label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants