DEV Community

Andre Carstens
Andre Carstens

Posted on • Edited 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

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️