before I start explaining my situation I would like to say that I have researched the problem from Google, and I will provide examples.
My Post has sections for easy reading! Please go through them at your needs.
# Table Of Contents:
- What I am I trying to do?
- What am I using?
- What have I tried/what is your code doing?
What I am I trying to do?:
I would like to be able to press my debugger's green launch button while I have an already running Brave browser in the background! I wish for it to open a new tab in the already-running brave browser. The default is a new window with my brave profile removed.
What am I using?:
-Brave browser -Visual Studio Code and debugger -NextJs
What have I tried/what is your code doing?
Most answers have either a mix of using the Command Prompt, launch.json, or both. All tries where made using the resources above. Let's start with the most popular answer.
Try 1:
The most popular configuration is
launch.json:
"configurations": [
{
"type": "chrome",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"userDataDir": false,
"request": "launch",
"name": "Launch Program",
"port":3000,
"webRoot": "${workspaceFolder}",
}
]
and a combination of typing the executable path with a port in a CLI (command prompt): an image of what I am talking about
as you can see from the picture the CLI dose not like the path I gave
and as far as launching the code the browser startup page launches but it gives this error:
unable to launch browser: "Could not connect to debug target at http://localhost:3000: Could not find debuggable target"
when you search the error directly it gives an unable to find any articles error. If you search parts of the error it will give you unrelated topics
The application still doesn't go into debug mode due to the error
Try 2: The launch.json for this try is the same as try 1. The difference is in how i prompt the CLI.
here is how I prompted it In this example the browser startup page comes up. I then pick a profile and start the vsc debugger. It gives the same error as try 1.
Try 3:
In this try the launch.json is the same as in the first try but I changed the port in the CLI to the port in the json.
the same thing happens in this try that happened in the second.
Try 4: In this try we start changing the launch.json.
"configurations": [
{
"type": "chrome",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"userDataDir": false,
"request": "attach",
"name": "Launch Program",
"port":3000,
"webRoot": "${workspaceFolder}",
}
]
with this it gives the same error.
unable to launch browser: "Could not connect to debug target at http://localhost:3000: Could not find debuggable target"
Try 5:
In this try the launch.json looks like this:
"configurations": [
{
"type": "chrome",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"userDataDir": false,
"request": "launch",
"name": "Launch Program",
"webRoot": "${workspaceFolder}"
}
]
in this one a new tab launches in the browser just like I want except an about:blank page shows instead of my local host.
the error in the vsc error prompt says:
unable to launch browser: "Unable to attach to browser"
Try 6:
In this try the launch.json looks like this:
"configurations": [
{
"type": "chrome",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"userDataDir": true,
"request": "launch",
"name": "Launch Program",
"webRoot": "${workspaceFolder}",
"url": "http://localhost:3000/*"
}
]
no error that stops the program is given
it launches a new window without any profile data with 2 tabs:
http://localhost:3000/ about:blank page
in the output console it says
Could not read source map for chrome-error://chromewebdata/: Unexpected 503 response from chrome-error://chromewebdata/neterror.rollup.js.map: Unsupported protocol "chrome-error:"