Unable to access middleware before initialization
I'm using router and tanstack start for server functionality and i keep getting the following error:
[request error] [unhandled] [GET] https://tanstack-ume-ume-gih3m7v73-ume-projects.vercel.app/
ReferenceError: Cannot access 'dbMiddleware' before initialization
To give more context in dbMiddleware. I define this inside of server/middleware/auth-middleware.ts
this is then used in server functions using the following:
I'm hoping somebody might be able to help me or has ran into a similar issue.