Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Athena Express with NextJS #83

Open
AvidDabbler opened this issue Jul 5, 2022 · 0 comments
Open

Using Athena Express with NextJS #83

AvidDabbler opened this issue Jul 5, 2022 · 0 comments

Comments

@AvidDabbler
Copy link

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'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant