middleware (request) parameter is not working in nextjs14
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
Hey, I was trying to learn middlewares in nextjs for creating protected route, as am trying to make this blog app using nextjs.
But here is the (request) object in the parameter is not showing anything inside it? can you help why is it so? withn typescript, I saw it is used in same way, but the only difference was, (request : NextRequest) because it has to declare types. But when I am trying it in javascript, and I don't have to declare any type for the request, It should show me something there, as per the docs, but its not. any help?
But here is the (request) object in the parameter is not showing anything inside it? can you help why is it so? withn typescript, I saw it is used in same way, but the only difference was, (request : NextRequest) because it has to declare types. But when I am trying it in javascript, and I don't have to declare any type for the request, It should show me something there, as per the docs, but its not. any help?
4 Replies
Giant panda
so you want to get type definition without typescript ?
Giant pandaOP
I don't know, I just want that request should work, and it should have some data, whether in typescript or javascript
Giant panda
you can use console.log
for that