Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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}"
}
like image 420
Purushottam Nawale Avatar asked Jan 22 '26 14:01

Purushottam Nawale


1 Answers

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

like image 196
Patrick Farrell Avatar answered Jan 24 '26 19:01

Patrick Farrell