I've updated the Angular application to version 18 (18.0.1). I'm facing some issues regarding the HTTP requests on localhost. For most of the requests, I'm getting a 404. I'm behind a corporate proxy and I have a file configured which was not touched lately. The only thing which changed was basically the angular version, from 17.1.0 to 18.0.1. The https-proxy-agent package is v5 (I've also tried to update it to 7 but no changes).
Has anyone faced similar issues? I don't know exactly what could be the problem and where to look.
I had the same problem. After upgrading angular to 18.2.x most of request returns 404. Previous proxy.conf.json configuration looks like:
"/api/*": {
I changed to:
"/api": {
And my app is working.
Ensure that your proxy.conf.json file is correctly configured
{
"/api": {
"target": "http://backend-server:port",
"secure": false,
"changeOrigin": true
}
}
Make sure the angular.json file has the correct configurations
"serve": {
"options": {
"proxyConfig": "src/proxy.conf.json"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With