Next.js Discord

Discord Forum

Middleware setup + Global Css not getting implemented

Answered
Yacare Caiman posted this in #help-forum
Open in Discord
Yacare CaimanOP
Hi,
I’ve set up middleware so that if a user isn’t logged in, they are redirected to the login page.

The issue is that I have to explicitly include the global CSS file; otherwise, my form (even the one from ShadCN) doesn’t work. Why is that?
Have i setup my app wrong? Im using app router.
Answered by Anay-208
have you exported matcher from middleware
View full answer

6 Replies

Answer
IIRC if you haven't it'll run on all paths
even _next
@Anay-208 have you exported matcher from middleware
Yacare CaimanOP
I have not.
Read the docs. It was right there thank you.
@Anay-208 Can you mark solution?
Yacare CaimanOP
Yes.