question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.0.0-rc.11 - $fetchRaw2 error - reason: connect EADDRNOTAVAIL :::3000 - Local

See original GitHub issue

Environment

  • Operating System: Linux - Ubuntu 20.04.5 LTS
  • Node Version: v16.17.0
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: npm@8.15.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

run…

npx nuxi init test-app

npm i

npm run dev

Describe the bug

After having an issue upgrading to the latest release candidate I get error…

500

request to http://[::]:32100/nuxt_vite_node/manifest failed, reason: connect EADDRNOTAVAIL :::32100 - Local (:::0) ()

at async $fetchRaw2 (./node_modules/ohmyfetch/dist/shared/ohmyfetch.c2a48baf.mjs:132:20) at async ./.nuxt/dev/index.mjs:457:20 at async ./.nuxt/dev/index.mjs:526:64 at async ./.nuxt/dev/index.mjs:106:22 at async ./node_modules/h3/dist/index.mjs:592:19 at async Server.nodeHandler (./node_modules/h3/dist/index.mjs:538:7)

So I created a completely clean install but still get the same issue.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
danielroecommented, Sep 27, 2022

Reproduction without Nuxt:

> const server = require('http').createServer((req, res) => { res.end('hi') })
> server.listen(4000)
> server.address()
{ address: '::', family: 'IPv6', port: 4000 }
> require('http').request('http://[::]:4000')
Uncaught Error: connect EADDRNOTAVAIL :::4000 - Local (:::0)

I think it might be best to default to 127.0.0.1 for vite-node as this will work even if no ipv4 port is open. Forgot I already raised a PR that resolves this: https://github.com/unjs/listhen/pull/40.

A workaround for now is either to run nuxt dev --host 0.0.0.0 (or 127.0.0.1 if you are not running within a docker container) or to update your Dockerfile:

  EXPOSE 3000

+ ENV HOST=0.0.0.0

  ENTRYPOINT yarn dev

Note: this will be resolved in the next release of nuxi that incorporates https://github.com/unjs/listhen/pull/40.

5reactions
Dawntraozcommented, Oct 30, 2022

Hi @danielroe 👋

In my case, I’m having this issue when I install the project and add SSL parameters to the script (using Node >= v18).

"dev": "nuxt dev --host 0.0.0.0 --https --ssl-cert localhost.pem --ssl-key localhost-key.pem"

Complains about a failed fetch like the other comments https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#fetch-experimental

If I downgrade to node version 16.18.0, it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

listen EADDRNOTAVAIL error in Node.js - Stack Overflow
It was fixed by changing the address my server was listening to. My config: app.set('port', process.env.PORT || 3000); ...
Read more >
Node.js websocket error “Error: listen EADDRNOTAVAIL Error
Application work fine on localhost .but when its connect to server it getting error. I connect server through port 22.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found