Any Clerk gurus in here? Following the Next.js 13 getting started guide renders blank screen
Following the getting started with nextjs guide for clerk renders a completely blank screen. I've followed it to a T, can't even set it up lmao. What am I doing wrong here? If I can't follow the getting started successfully then.....
.env.local configuered with NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY
src/app/page.tsx
./middleware.ts
src/app/layout.tsx
8 Replies
Repo for reproduction can be easily created if needed
@James Perkins if I can get a royal pardon for pinging you (if this gets me banned, so be it), can you provide some assistance? We're trying to determine whether clerk is a good fit for a client project at work, and getting stumped at the first hurdle is a adding the two folders for sign-in and sign-up with the correct pages, im now hitting
Error: Clerk: auth() was called but it looks like you aren't using
authMiddleware in your middleware file. Please use
authMiddleware and make sure your middleware matcher is configured correctly and it matches this route or page
. despite middleware.ts being in the ROOT of the project
After moving the middleware.ts file between src/app and src the error remains. ban him! Get the ban hammer out.
Now itβs cool. Can you give me a repo?
GitHub
GitHub - JamesIde/clerk-next13-app-dir-woes
Contribute to JamesIde/clerk-next13-app-dir-woes development by creating an account on GitHub.
thanks @James Perkins, gotta bounce as its late here... will have a squiz in the morning at the docs again to see if ive missed anything
i made some changes to the folder structure as I was completely doing it wrong, but middleware problem remains... signin/up should be in correct place now
Here is the PR π https://github.com/JamesIde/clerk-next13-app-dir-woes/pull/1
GitHub
Fixes Clerk by perkinsjr Β· Pull Request #1 Β· JamesIde/clerk-next13-...
Puts middleware in the correct place src/ which is the root in a project when using the src directory.
I also added UserButton and a auth() to the page so you can see the entire flow.
middleware was in the wrong place should of been in
src
which is the root if you select that. I also added a userbutton and auth() so you can see it all work.Incredible... and also embarrassing i didnt realise the correct location
Thanks a lot!
anytime π