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.
2. 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:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://my_backend_container:3001/api/v1/nodes/common/all. (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://my_backend_container:3001/api/v1/nodes/common/all. (Reason: CORS request did not succeed). Status code: (null).
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?