DEV Community

Andre Carstens
Andre Carstens

Posted on • Updated on

Asp.Net core SPA proxy wont start

When I was trying to start an existing .net core 6 project that has a React SPA embedded in it, I was getting an error that the proxy server was not responding. I spent a lot of time trying to find out where the proxy port is declared, people said its in the package.json file or in launch.settings. I didnt find the port, but I did find out that the proxy spa feature of .net core looks for an avaialble port to forward to, so it isnt from a setting file.

Anyway, even after finding this out, it made no difference, the SPA app wouldnt start. I tried changing the startup.cs settings
for the SPA.

if (env.IsDevelopment())
spa.UseProxyToSpaDevelopmentServer("http://localhost:xxx")

}
I went from using spa.UseReactDevelopmentServer to spa.UseProxyToSpaDevelopmentServer("http://localhost:"). It didnt help.

Eventually, I tried using a cmd line in the Clientapp\ folder to get npm to start the app.

`npm start

npm threw an error ERR_OSSL_EVP_UNSUPPORTED.`

This was related to an update made to node that moved them from OpenSSL 1.x to OpenSSL 3.x

Eventually, I added the script below to the package.json, and the project finally started working again.

   "start": "rimraf ./build && react-scripts --openssl-legacy-provider start",

Enter fullscreen mode Exit fullscreen mode

Top comments (0)