Next.js Discord

Discord Forum

Help with runtime error

Unanswered
Prairie yellowjacket posted this in #help-forum
Open in Discord
Prairie yellowjacketOP
I get the following error when running pnpm dev.

I've already tried deleting node_modules, .next, clearing the pnpm cache, and reinstalling the modules, but I still get the same error.

The packages I'm using are in the image.

4 Replies

@Dutch remove middleware and try again
Prairie yellowjacketOP
When I remove the middleware everything works perfectly, the problem is that I need to use it to protect routes, I tried configuring it as an example given in the authjs documentation but I still have the same error, although at least now I know that the error is being caused by the middleware
@Dutch yes middleware is not secure for a while, try to find another way
Prairie yellowjacketOP
Thanks, I'll try to find another way to solve the error.