【问题标题】:SPA server for localhost not working, can't find localhost本地主机的 SPA 服务器不工作,找不到本地主机
【发布时间】:2022-01-17 08:20:42
【问题描述】:

我有一个在后端使用 .NET 的 React.js 项目。我切换了计算机,从 git 中提取文件,并期望一切正常。但是我无法启动并运行本地服务器。我收到以下错误:

'SKGVT.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.1\System.Net.WebSockets.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SKGVT.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.1\System.Threading.Tasks.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager: Error: Couldn't start the SPA development server with command 'npm start'.
Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager: Information: No SPA development server running at https://localhost:44449 found.
The thread 0x6108 has exited with code 0 (0x0). ```

It seems like its a fault with the localhost URL, but I cant figure out where I change this.

【问题讨论】:

  • 你安装了 npm 吗?
  • 是的,NPM 已安装。
  • 我猜 NG 被配置为 http 并且 SpaProxy 试图加载 https。

标签: asp.net reactjs localhost


【解决方案1】:

我不确定你是否解决了这个问题,但我也遇到了。对我来说,问题是我的 setupProxy.js 期望我使用 SSL。

我通过在 setupProxy.js 中注释掉目标并将其替换为 http://localhost:PROXYPORTHERE 来“修复”此问题。

某人 :)

【讨论】:

    猜你喜欢
    • 2013-09-28
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-25
    • 2017-06-23
    • 1970-01-01
    相关资源
    最近更新 更多