Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nitro dev server doesnt work in Docker and Nginx - Socket Hang Up - ECONNRESET #2904

Open
poziminski opened this issue Nov 26, 2024 · 0 comments

Comments

@poziminski
Copy link

poziminski commented Nov 26, 2024

Environment

nitropack 2.10.4
nuxt 3.14.1592
docker + docker-compose

Reproduction

https://github.com/poziminski/nuxt-bug-reproduction

Describe the bug

I have a feeling it might be connected more to Nitro than to Nuxt itself (might be connected to Vite or nginx?). The bug appears at least from July 2024, since we started a new project. Happens almost every day. Currently cant even run e2e tests and can't continue with development.

I prepared minimal code with newest dependencies using nuxi init:
https://github.com/poziminski/nuxt-bug-reproduction

It is a docker-compose-dev.yml config + 2 services:

services/nginx
services/web (nuxt 3 app)

Usually nginx lets me access app via http://localhost/web/, but Nitro server shows error in web app and it doesnt load at all.

To run:
docker-compose -f docker-compose-dev.yml up --force-recreate

Then go to localhost for few times and check error messages in containers/terminal.

Worth noticing is that running project locally (without Docker) works fine.

My setup: Macbook M2 + Macos 14.4.1 (23E224)

Zrzut ekranu 2024-11-26 o 16 49 54

Additional context

No response

Logs

nuxt_bug_reproduction-web-1    | [nitro] ✔ Nuxt Nitro server built in 600 ms
nuxt_bug_reproduction-web-1    | ℹ Vite client warmed up in 1ms
nuxt_bug_reproduction-web-1    | ℹ Vite server warmed up in 629ms
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |  ERROR  [unhandledRejection] socket hang up
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |   at connResetException (node:internal/errors:720:14)
nuxt_bug_reproduction-web-1    |   at Socket.socketOnEnd (node:_http_client:525:23)
nuxt_bug_reproduction-web-1    |   at Socket.emit (node:events:529:35)
nuxt_bug_reproduction-web-1    |   at endReadableNT (node:internal/streams/readable:1400:12)
nuxt_bug_reproduction-web-1    |   at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |  ERROR  [unhandledRejection] connect ECONNREFUSED 127.0.0.1:44719
nuxt_bug_reproduction-web-1    |
nuxt_bug_reproduction-web-1    |   at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant