"Cannot call server function outside of a request" in onRequest middlware hook
This doesn't happen all the time. But happens.
2 Replies
The first ever trigger of the route, I see this.
Doesn't happen on subsequent triggers
I just got this, found out it was from calling a server function (a function marked with 'use server') inside of middleware
I guess you cannot call server functions in middleware
this looks like it is your case seeing that an error occured in "onRequest"