Skip
Nuxt 3 Modules & defineAsyncComponent
I created my own Nuxt 3 module, which i added composable to. In it, i do dynamic component imports:
But it seems that
~
is not recognized when used outside the project. How do I implement asynchronous component import in a module?1 replies
Nuxt 3 + Docker + Nginx = 502 bad gateway
I'm trying to run a production version of Nuxt 3 with SSR on my server.
My yml config:
Part of nginx config:
My Dockerfile:
My Docker container with frontend run app with this command:
But mysite.com show me 502 bad gateway error. Any ideas why it is happening?
5 replies
Nuxt 3 in Docker and NGINX
I use nginx as a reverse proxy for my web applications. My backend and SPA are proxied perfectly. But i don't really understand how i can proxy my application on Nuxt 3 after I make a build...
Can someone tell me please the approximate steps or share nginx config for production?
Many thanks!
7 replies
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:
1. 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.
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:
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?16 replies