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

What am I doing wrong? Nextjs: ^13.2.4 Nodejs: 18.5.0
10 Replies
deforestor
deforestor14mo ago
Literally only thing I can think of is.. maybe not in the correct route?
Ali
Ali14mo 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
deforestor14mo ago
that really is strange, I can't think of anything else to be honest
Ali
Ali14mo ago
well, it was a stupid mistake
deforestor
deforestor14mo 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
Ali14mo ago
it should be (req, res) and not ({req,res})
deforestor
deforestor14mo ago
got it
Ali
Ali14mo ago
for edge runtime it is ({req})
gnarley_farley.
gnarley_farley.2mo ago
Did you figure this out
Ali
Ali2mo ago
yeah, read the chats above