Global Middleware not working in prod
Hello, I have global-middleware.ts, with
registerGlobalMiddleware at the end. I import ./global-middleware from server.ts (I also tried importing it from router.tsx). The middleware runs fine in development, but not in production (I added log to the middleware functions to check). Anyone else experience this?1 Reply
rival-blackOP•3mo ago
It's placed in
src/global-middleware.ts next to router.tsx and server.ts. The global-middleware documentation mentions app/global-middleware.ts though the examples all use src/, not app/
This is what is required. In package.json: