Next.js Discord

Discord Forum

Vercel middleware not executing

Answered
Large garden bumble bee posted this in #help-forum
Open in Discord
Large garden bumble beeOP
Hello everyone!

I'm kind of stuck right now on this issue. I have a middleware, which if i run in dev mode works completely as intended, but when i build it the middleware just kind of dissapears i think.

Vercel deploy page:
https://srp-resslova-fami6xx.vercel.app

Middleware code:
Answered by Asian black bear
can you mv middleware.js src/
View full answer

24 Replies

Large garden bumble beeOP
Large garden bumble beeOP
few hours later and couldn't find an answer :/
Asian black bear
Can you open up the middleware logs in your vercel deployment and see if it is running?
Large garden bumble beeOP
opened up the site and refreshed the logs, nothing is showing
This is the source & output of build
Asian black bear
it doesn't show logs from before you opened that page, so go ahead and makes some requests
Large garden bumble beeOP
Asian black bear
It appears to be running, how is its function deviating from your expectations?
maybe it is doing something that only worked on the dev server
Large garden bumble beeOP
well, its not running, i just checked requests too so that you can see that i tried refreshing the page
Asian black bear
ohhh
😭 😭
under your build details on vercel do you see stuff like this?
Large garden bumble beeOP
nope, not showing
Asian black bear
I think maybe this is a good clue
Asian black bear
can you mv middleware.js src/
Answer
Large garden bumble beeOP
yeah, you're right
gosh thanks so much man
Asian black bear
right on, I thought it was supposed to go there, but it working in the dev server confused me
Large garden bumble beeOP
yeah me too,
Asian black bear
I hope your project goes well!
Large garden bumble beeOP
thanks! have a great day!