Skip to content

Nuxt v3.11.0 proxyRequest in server api routes makes nitro crash if proxy server is down #26318

@geminigeek

Description

@geminigeek

Environment


  • Operating System: Linux
  • Node Version: v20.11.1
  • Nuxt Version: 3.11.0
  • CLI Version: 3.10.1
  • Nitro Version: 2.9.4
  • Package Manager: bun@1.0.29
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/geminigeek/proxy-request-nitro-error

clone repo
bun install
bun run dev

visit http://localhost:3000/api/hello

then try reloading http://localhost:3000, app home page , nothing happens , it seems nitro crashed

Describe the bug

after a failed proxy request to a dead proxy server, the error is unhandled it crashes nitro/h3.
error in console is below


 ERROR  [nuxt] [request error] [unhandled] [500] fetch failed
  at node:internal/deps/undici/undici:12345:11
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async sendProxy (./node_modules/h3/dist/index.mjs:1157:20)
  at async ./node_modules/h3/dist/index.mjs:1962:19
  at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)
  at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:2249:7)

Additional context

same was working as expected in 3.10.3

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions