首页 > 解决方案 > React.js localhost 拒绝连接

问题描述

我已经离开了我的 react 项目一段时间,它工作正常,但是当我回到它并在 chrome 上运行时,它给出了一个 localhost 拒绝连接页面,我不知道为什么。

我看到一篇帖子说要下载扩展 Live Server,但是,它只是打开一个包含编写代码的页面,而不是运行它。

这是我运行调试器时自动创建的 launch.json,

{
    // 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}"
        }
    ]
}

任何建议都会很棒,谢谢

标签: reactjs

解决方案


推荐阅读