Search code examples
.netangularvisual-studiovitevisual-studio-2022

'Vite. http proxy error at /weatherforecast...' error when launching the Angular and ASP.NET Core app in Visual Studio


I created an app from the 'Angular with ASP.NET Core' project template in Visual Studio 2022 17.8 and .NET 8. It launches the API app in Chrome and the Angular app in Edge. In Edge it doesn't show the weather temperature values. I see the error below in the console. The app used to work but then I tried to make Chrome the default browser for the Angular app and it never properly anymore. I made Edge the default browser for the Angular project. I also deleted and recreated the app several times and it never worked correctly anymore. Using Node 20 and Angular 17.

What could be the issue? I don't know much about Vite and how it relates to the reverse proxy in ASP.NET.

Error:

[vite] http proxy error at /weatherforecast: AggregateError at internalConnectMultiple (node:net:1114:18) at afterConnectMultiple (node: net: 1667:5)

enter image description here


Solution

  • I was creating the app with the 'Configure for HTTPS' unchecked. I was seeing some SSL errors even though it's not supposed to be using https and ssl. When I created the app with it checked, it worked. I don't know why.