Skip to content

Nuxt 4 can't run with Deno #1240

Closed as duplicate
Closed as duplicate

Description

@carsonbird

Environment

  • Operating System: Linux
  • Node Version: v22.14.0
  • Nuxt Version: 4.0.1
  • CLI Version: 3.26.4
  • Nitro Version: 2.12.4
  • Package Manager: deno@deno 2.4.2 (stable, release, x86_64-unknown-linux-gnu) v8 13.7.152.14-rusty typescript 5.8.3
  • Builder: -
  • User Config: compatibilityDate, ssr, devtools, modules
  • Runtime Modules: @nuxt/[email protected], @nuxt/[email protected]
  • Build Modules: -

Reproduction

  1. Use npx nuxi@latest init app, select deno.
  2. Start dev server with deno task dev.
    1. this issue also occurs with NUXT_SOCKET=0 deno task dev, deno run --allow-env=TMPDIR --allow-read="/tmp" --allow-write="/tmp" dev, deno task dev --allow-all, NUXT_SOCKET=0 deno task dev --allow-env.
  3. Load the page at localhost:3000.

Describe the bug

Upon attempting to load the webpage, the dev server spits out the following. The webpage never actually loads.

 ERROR  [unhandledRejection] connect ECONNREFUSED nuxt-dev-3563.sock

    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:91:3)
    at __node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:215:10)
    at PipeConnectWrap._afterConnect [as oncomplete] (node:net:177:16)
    at Pipe.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:43:11)
    at ext:deno_node/internal_binding/pipe_wrap.ts:130:14
    at eventLoopTick (ext:core/01_core.js:178:7)

Additional context

No response

Logs

ERROR  [unhandledRejection] connect ECONNREFUSED nuxt-dev-3563.sock

    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:91:3)
    at __node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:215:10)
    at PipeConnectWrap._afterConnect [as oncomplete] (node:net:177:16)
    at Pipe.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:43:11)
    at ext:deno_node/internal_binding/pipe_wrap.ts:130:14
    at eventLoopTick (ext:core/01_core.js:178:7)

Activity

  1. neonbyte1 commented on Jul 24, 2025

    @neonbyte1

    Facing the same problem even without any module, just created a fresh project. Also tried running it via deno run -A --node-modules-dir nuxt dev but same result.

  2. Amereth commented on Jul 27, 2025

    @Amereth

    had same issue. this worked for me
    deno run dev --no-fork

    nuxt/nuxt#23832 (comment)

  3. chrisprobst commented on Oct 10, 2025

    @chrisprobst

    Second that, nuxt and deno are incompatible. nuxt/nuxt#23832 (comment)

    Yes, --no-fork works, but why? And what are the implications?

  4. carsonbird commented on Oct 10, 2025

    @carsonbird
    Author

    --no-fork doesn't work for me. It works temporarily, I think interrupting hot reload, but after a few minutes it starts crashing too.

  5. sandros94 commented on Oct 12, 2025

    @sandros94
    Member

    Recently I started switching to deno (mostly just to test and learn new stuff) and haven't had much problem with it, until today.

    Tracing the issues it seems that it should be related on how Nitro v2 handles both deps and server listening, something that is basically being rewritten from scratch with Nitro v3 (and Nuxt v5).

    As I get some time I will try out Nitro v3 alpha and see if I'm able to reproduce these issues there too, but I doubt it

    EDIT: no issue with Nitro v3

  6. Us3r-gitHub commented on Mar 7, 2026

    @Us3r-gitHub

    I’m not sure if my issue is related to this, but I’m using the Deno extension in VSCode and it seems that Nuxt’s autoImports aren’t fully compatible — shared types are inferred as any instead of the types I’ve defined.

    I’ve also created an issue on the Deno repo regarding this: denoland/deno#32549.

  7. transferred this issue fromnuxt/nuxton Mar 7, 2026
  8. Us3r-gitHub commented on Mar 7, 2026

    @Us3r-gitHub

    I’m using the Deno extension in VSCode and it seems that Nuxt’s autoImports aren’t fully compatible.

    I've tried running typecheck using nuxi and deno. It passes with nuxi, but errors when using deno.
    Maybe there's some configuration needed for Deno to run typecheck successfully. This might also be related to the Deno LSP behaving incorrectly.

    Image
  9. BlueskyFR commented on Mar 14, 2026

    @BlueskyFR

    Can Nuxt cli be used with "nodeModulesDir": "none"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions