Cannot Set headers after they are sent to the client on 9.55 [Works on 9.4.4 ] #16841
Unanswered
danilockthar
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, im retrieving data from my Fauna database, but im getting this error on console and crashing my app in production mode because of this ( Is the only error log that appears on my vercel log ). If i go to previous and working next version like 9.4.4 its seems to ignore the error and works without problem. But Next last version doesnt allow me to let it pass the error ..
This is my api route code:
`const jsonwebtoken = require('jsonwebtoken')
import {verify} from 'jsonwebtoken'
import {q, client} from '../../lib/db'
export default async function shows(req, res) {
}`
[GET] /api/profile 00:34:25:24 2020-09-04T03:34:25.571Z 0a37b96a-3dfa-43f0-9730-f0ccc855c335 ERROR Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at ServerResponse.setHeader (_http_outgoing.js:518:11) at sendJson (/var/task/node_modules/next/dist/next-server/server/api-utils.js:42:5) at ServerResponse.apiRes.json (/var/task/node_modules/next/dist/next-server/server/api-utils.js:6:283) at shows (/var/task/.next/serverless/pages/api/profile.js:191:7) at apiResolver (/var/task/node_modules/next/dist/next-server/server/api-utils.js:8:7) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async module.exports.RLkh.__webpack_exports__.default (/var/task/.next/serverless/pages/api/profile.js:920:11) { code: 'ERR_HTTP_HEADERS_SENT' }
Beta Was this translation helpful? Give feedback.
All reactions