Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Uncaught Exception in Next.js API Route #73

@zouantchaw

Description

@zouantchaw

I encountered an uncaught exception in my Next.js API route. The error message I received was:

// 500 Internal Server Error

Uncaught Exception 	{"errorType":"Error","errorMessage":"Unexpected server response: 400","stack":["Error: Unexpected server response: 400","    at ClientRequest.<anonymous> (/var/task/node_modules/.pnpm/ws@7.4.6/node_modules/ws/lib/websocket.js:604:7)","    at ClientRequest.emit (node:events:513:28)","    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)","    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)","    at TLSSocket.socketOnData (node:_http_client:534:22)","    at TLSSocket.emit (node:events:513:28)","    at addChunk (node:internal/streams/readable:315:12)","    at readableAddChunk (node:internal/streams/readable:289:9)","    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)","    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)"]}
Unknown application error occurred
Runtime.Unknown

I've tried adding additional error handling code to my API route, but I'm still experiencing this issue: route handler

I implemented the same routes in a new nextjs app and it work perfectly: new route handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions