visual-studio-codefirefoxvscode-debuggermozilla

Debugger for Firefox not working in VS Code


OS: Linux Ubuntu 22.04 LTS

I am trying to debug Angular/TypeScript code using VS Code in Firefox. I am encountering these two errors:

connect ECONNREFUSED 127.0.0.1:6000

When I install Firefox from Snap, I receive the following error:

your firefox profile cannot be loaded. it may be missing or inaccessible

However, when I install Firefox from Flatpak, the above error doesn't occur.

Here is my launch.json configuration for debugging with VS Code and Firefox:

launch.json

{
    "name": "Launch Firefox",
    "request": "launch",
    "type": "firefox",
    "url": "http://localhost:4200",
    "webRoot": "${workspaceFolder}"
}

Solution

  • You are likely using a firefox added by Snap. Snap needs an extra configuration in your launch.json to indicate a tmp dir it can use.

    Add "tmpDir": "/some/folder/of/yours/with/write/perms"

    Note, this folder should probably be in your home directory. I used ${HOME}/tmp and create a tmp dir in my home directory.

    Answer was found on askUbuntu