Nuxt 3 with Docker and Backend
I have a REST that works fine in Dev and Prod mode with SPA Vue 3.
As a frontend for my application, I have chosen Nuxt 3 and am getting the following problem:
And get Error:
But now if I switch to another route and come back I get this error:
I use NGINX as reverse proxy & CORS is enabled on my backend.
In my dashboard Vue 3 works fine with my API. But in Nuxt 3 i get the problems described above. Please tell me what am I doing wrong?
As a frontend for my application, I have chosen Nuxt 3 and am getting the following problem:
- On the page i make a call to my API:
And get Error:
fetch failed () if i reload browser page or if i trying to access the page directly. But if i switch to another route and come back, the call above works and I get the data.- I can solve this problem if instead of localhost, I specify the name of my backend container:
But now if I switch to another route and come back I get this error:
I use NGINX as reverse proxy & CORS is enabled on my backend.
In my dashboard Vue 3 works fine with my API. But in Nuxt 3 i get the problems described above. Please tell me what am I doing wrong?