Undici errors kicking my tail
Unanswered
Netherland Dwarf posted this in #help-forum
Netherland DwarfOP
I'm frequently getting the following error in my logs:
Here's my code that is "causing" it:
more details in following post because of posting size limits.
SyntaxError: Unexpected token 'Y', "You made a"... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5472:19)
at successSteps (node:internal/deps/undici/undici:5454:27)
at fullyReadBody (node:internal/deps/undici/undici:4381:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async consumeBody (node:internal/deps/undici/undici:5463:7)
⨯ unhandledRejection: SyntaxError: Unexpected token 'Y', "You made a"... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5472:19)
at successSteps (node:internal/deps/undici/undici:5454:27)
at fullyReadBody (node:internal/deps/undici/undici:4381:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async consumeBody (node:internal/deps/undici/undici:5463:7)
⨯ unhandledRejection: SyntaxError: Unexpected token 'Y', "You made a"... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5472:19)
at successSteps (node:internal/deps/undici/undici:5454:27)
at fullyReadBody (node:internal/deps/undici/undici:4381:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async consumeBody (node:internal/deps/undici/undici:5463:7)Here's my code that is "causing" it:
export const getInterview = async (id: string) => {
const interviewKey = `interview:${id}`;
const interview = await edgeDbClient.json.get(interviewKey, '$');
if (!interview) {
return;
}
return interview?.[0] as InterviewCache;
}more details in following post because of posting size limits.
2 Replies
Netherland DwarfOP
I'm scare quoted "causing" because this code isn't where it is breaking. If i trace past that into the edgeDbClient.json.get function, it eventually breaks deep within the next-js code, actually on a mget function within one of the chunked-xxx.js files.
It's also worth a scare quote because this is not the only place where this error happens. I'd say there are at least 3-4 other places that throw this error. I'm not using JSON.parse or fetch in these parts of the app.
What I've done:
- I've tried all sorts of things to chase down there the "You made a" is coming from. Wiresharked packets, traced variables, dug deep into my source and module source, can't find it.
- googled the crap out of this issue - it appears people were having a similiar experience (https://github.com/vercel/next.js/issues/47554, among others) and it is as irritably random for them.
- searched the forums here. I found this one https://nextjs-forum.com/post/1260496309974990949#message-1260496309974990949 but not quite the same issue.
- I am using Clerk, inngest, sentry and upstash, all of whom are possible culprits based on the numerous posts I've read. But I've done a fair amount of troubleshooting there and can't seem to narrow it down.
final caveat, I'm a relatively inexperienced programmer so may be missing something totally obvious. Just looking to for some ideas to troubleshoot this further
It's also worth a scare quote because this is not the only place where this error happens. I'd say there are at least 3-4 other places that throw this error. I'm not using JSON.parse or fetch in these parts of the app.
What I've done:
- I've tried all sorts of things to chase down there the "You made a" is coming from. Wiresharked packets, traced variables, dug deep into my source and module source, can't find it.
- googled the crap out of this issue - it appears people were having a similiar experience (https://github.com/vercel/next.js/issues/47554, among others) and it is as irritably random for them.
- searched the forums here. I found this one https://nextjs-forum.com/post/1260496309974990949#message-1260496309974990949 but not quite the same issue.
- I am using Clerk, inngest, sentry and upstash, all of whom are possible culprits based on the numerous posts I've read. But I've done a fair amount of troubleshooting there and can't seem to narrow it down.
final caveat, I'm a relatively inexperienced programmer so may be missing something totally obvious. Just looking to for some ideas to troubleshoot this further
Netherland DwarfOP
after much digging, the culprit was a mis-configured tinybird situation.