Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

localhost not working - chrome extension in vs code

In vs code, I have created a launch.json file in an HTML angularjs project. I am not able to launch the project in my localhost. It keeps on saying as Failed to load resource: net::ERR_CONNECTION_REFUSED (http://localhost:8080/).

Project Structure:-

Project => .vscode => launch.json
        => app
        => scripts
        => styles
        => index.html

launch.json:-

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Chrome against localhost, with sourcemaps",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:8080",
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}"
        },
        {
            "name": "Attach to Chrome, with sourcemaps",
            "type": "chrome",
            "request": "attach",
            "port": 9222,
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}"
        }
    ]
}

Can someone help me to solve this? Thanks in advance

like image 465
Abraham Gnanasingh Avatar asked Mar 19 '26 16:03

Abraham Gnanasingh


1 Answers

I was experiencing the same issue.

Changing my launch.json file to the following solved the issue (Chrome is my default browser):

{
    // 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": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\\app.js"
        }
    ]
}

Where app.js was in my root folder of the workspace.

Here's what was the preivous launch.json file:

{
    // 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": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}
like image 192
Saylo Avatar answered Mar 21 '26 05:03

Saylo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!