You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am transferring a node js app over to NextJS and I keep getting this error when I make queries to the API endpoint. It seems like there is an issue with Next trying to update the header information.
Any thoughts on how I might be able to fix this issue?
error - Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (node:internal/errors:371:5)
at ServerResponse.setHeader (node:_http_outgoing:576:11)
at sendJson (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/api-utils/node.js:313:9)
at ServerResponse.apiRes.json (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/api-utils/node.js:163:31)
at handler (webpack-internal:///(api)/./src/pages/api/athena/routes.ts:17:21)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.apiResolver (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/api-utils/node.js:179:9)
at async DevServer.runApi (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/next-server.js:381:9)
at async Object.fn (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/base-server.js:488:37)
at async Router.execute (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/router.js:213:36)
at async DevServer.run (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/base-server.js:621:29)
at async DevServer.run (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/dev/next-dev-server.js:533:20)
at async DevServer.handleRequest (/home/aviddabbler/Documents/dev/iotransit/transit-chat/node_modules/next/dist/server/base-server.js:317:20) {
code: 'ERR_HTTP_HEADERS_SENT',
page: '/api/athena/routes'
}
The text was updated successfully, but these errors were encountered:
I am transferring a node js app over to NextJS and I keep getting this error when I make queries to the API endpoint. It seems like there is an issue with Next trying to update the header information.
Any thoughts on how I might be able to fix this issue?
The text was updated successfully, but these errors were encountered: