HMR in docker not working
Hey, I just created a fresh project and put that into a docker container. When I start the container I realized HMR is not picking up any changes in code... any idea what the issue could be here?
Dockerfile
FROM node:lts
WORKDIR /app
COPY ./package*.json /app/
RUN yarn install
COPY . .
EXPOSE 3000
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
CMD [ "yarn", "dev", "-0" ]
3 Replies
you will also need to open the port that vite uses for websocket communication, which is 24678 by default
so adding EXPOSE 24678 should solve the issue?
it works... thanks
was that correct with the solution I posted? Because now when I stop and restart the container I am getting another error which I did not get before: Error: listen EADDRINUSE: address already in use /tmp/nitro/worker-29-1.sock
solved it via a docker-compose file and map both ports there... without the compose it wont work... anyway the main issue is been solved... thanks
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View