TypeError: Cannot read properties of undefined (reading 'status')

What am I doing wrong? Nextjs: ^13.2.4 Nodejs: 18.5.0
10 Replies
deforestor
deforestor3y ago
Literally only thing I can think of is.. maybe not in the correct route?
Ali
AliOP3y ago
no, api/query/[userId] It is correct. It drives me crazy I wasted several hours on it. and still can't make a simple request! the only way it works is when I make a req on runtime
js
export const config = {
runtime: 'edge',
};
js
export const config = {
runtime: 'edge',
};
deforestor
deforestor3y ago
that really is strange, I can't think of anything else to be honest
Ali
AliOP3y ago
well, it was a stupid mistake
deforestor
deforestor3y ago
Wait, what you mean when you say you can't make this work? Like, when you call it, it doesn't work? oh you fixed it? nice
Ali
AliOP3y ago
it should be (req, res) and not ({req,res})
deforestor
deforestor3y ago
got it
Ali
AliOP3y ago
for edge runtime it is ({req})
gnarley_farley.
Did you figure this out
Ali
AliOP2y ago
yeah, read the chats above

Did you find this page helpful?