auth not working with convex auth for nextjs app in mono repo
Hi there,
I have an existing Next.js app, but I realized that I might want to build a desktop app or a mobile app for what I'm building in the future. So I'm currently trying to migrate my Next.js app with Convex to be a mono-repo with Next.js and then Convex in the packages section of the Turbo Repo. I set everything up as I did before, in accordance to the Convex auth docs, but for some reason I get a log that says "api/auth/404" and I don't understand why.
When I set
verbose: true
in the convex middleware, I get these logs:
[Error: Route "/signin" used headers().get('Host')
. headers()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis]
[Error: Route "/signin" used cookies().get('__convexAuthJWT')
. cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis]
GET /signin 200 in 212ms
GET /favicon.ico?favicon.45db1c09.ico 200 in 357ms
[Error: Route "/[token]" used headers().get('Host')
. headers()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis]
[Error: Route "/[token]" used cookies().get('__convexAuthJWT')
. cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis]
GET /google.svg 200 in 579ms
Is it something I am doing wrong or is it something on Convex's end?2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Can you share your middleware here