Troubleshooting data fetch issues from ASP.NET backend in Nuxt frontend

Help needed with backend data retrieval problem

I’m having trouble getting data from my ASP.NET backend to my Nuxt frontend. The frontend keeps breaking and giving me a 503 error when I try to fetch data.

Here’s a snippet of what I’ve tried:

const { data } = await useFetch('https://api.mybackend.com/resources/3')

Swagger works fine on the backend, so I’m not sure what’s going on. I’ve tried curling the backend too, but it’s redirecting to a different port and giving empty replies.

I’ve already tried deleting the applicanthost.config file and rebuilding the project, but no luck.

Has anyone run into this before? Any tips on how to fix it? I’m totally stuck and could use some help figuring out what’s causing this issue.

Update: I fixed the port number, but now the frontend is unresponsive. I’ve also tried using Axios, but still no luck. Any ideas on what to try next?

hey climbin monkey, i had similar probs before. try checkin ur backend logs for any errors. also, make sure ur api route matches exactly whats in ur frontend code. sometimes a tiny typo can mess everything up. have u tried clearin browser cache? that fixed it for me once. gl!

hey there! have u considered using a proxy server to debug the issue? it mite help pinpoint where the communication’s breaking down. also, what about checking ur API authentication? sometimes tokens can expire n cause weird errors. btw, have u tried deploying to a different environment to see if it’s a local setup problem? jus curious what else youve explored :thinking:

It sounds like you’re dealing with a complex issue that could stem from multiple factors. Have you checked your CORS configuration on the backend? Sometimes improper CORS settings can cause these types of errors. Also, ensure that your API endpoints are correctly defined and match what you’re calling from the frontend.

Another possibility is that your network configuration might be affecting connectivity; for example, development firewalls might prevent certain connections. Given that Swagger appears to work while direct calls do not, it might be worthwhile to revisit your routing setup and verify that no conflicts exist.

Lastly, using your browser’s developer tools to inspect network requests could provide further insights into the miscommunication between your frontend and backend.