I get a very strange error in production
I get a very strange error in production but I don't get how to get its logs, vercel doesn't show anything
convex dashboard doesn't show anything in its functions too
anyone know what I can do in such cases?

55 Replies
this only happens in production
I think you imported an Convex server function into the client
interesting, can you help understand where I can import it
https://github.com/genxai/new
im checking
sign-in
route nowCan't find the root cause but I would check in local env, I had this issues once and my console was getting error log. I'd start debugging from there.
is there env responsible for server fn in convex
mby i missed adding it in vercel
but I think I added everything
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex
oh this doc I read, I think I got all envs from there
ok i think that maybe the cause as I do use custom domain

checking it more now
only thing its unclear what
CONVEX_CLOUD_URL
should beHi, I don't know who wrote the entire repo, but when I first saw it, to me it looked like an AI wrote the entire thing, This is why i seriously recommend that you learn what you're doing before implementing it, at least by a little bit..
Learn how to debug things, we tend to help out with things in a smaller area, things this big (and hard to debug) would be recommended to hire somebody.. please take this with a grain of salt
oh I didn't know it was AI written
I just found it from #hackathon
and it looked like it had auth working which is what I needed
and in my local tests auth worked
I essentially needed a starter with better auth
Pretty sure this uses Convex Auth and not Better Auth
I saw useConvextAuth somewhere

Could be massively outdated.
I'm sure it worked, it has way to much issues in prod, this is why i mentioned to debug it locally first
the problem is that this issue only appears in production
locally full flow works
thats why I asked how to debug as I can't get logs
Run npm build
And start fixing what ever causes it to fail
npm build passes
For convex? Let me read the docs
its runtime error
There's no way it runs
@Sara do you have a sec ? I have question about deployments.

or what do you mean
Give me a moment, imma try to run it on my end
are envs i have in prod for ref

it might be I miss some env for convex fn
@Sara can pull, i just pushed a commit to simplify auth to only otp
not that it is relevant to the issue
but i didn't need the other stuff
thank you lots for the help ❤️
I won't be spending more than 20 min on this
yea ofc
you're on your own after that
i really just need a way to get runtime logs somehow
if its convex fn failing

its strange as dash makes it seem like no fn are deployed even
and vercel doesn't show logs too strangely

I've already spotted soooo many problems:
1. tests need to be run in a seperate folder, and not just for "snapshots" or to make sure that a component mounts, because it always mounts 😅
2. the eslint has some bad rules like turning off the any type error, and using a deprecated config,
3. somehow, you've turned off everything that shows you the errors and helps you fix them, and it's causing both local and build to pass, but when you do anything (say interact with pages) you get type errors almost instantly
oo the eslint turn of is super bad indeed
I mentioned it to @Topf
ok i will sort eslint for now
also, Sometimmes it helps to read the error


and to make it make sense, in this case you'd use a link and give it the buttonVariants property
but this issue seems like it happens in convex function?
i think it is checking for session and is failing in production env only
you might not have the enviroment variables for the config defined
its failing immediatly because of it
Custom Domains & Hosting | Convex Developer Hub
Serve requests from any domains and host your frontend on any static hosting provider, such as GitHub.
i set all the envs asked here
also the envs i have in vercel are same ones in localhost (diff values only)
i checked
.env.local
*but if you read the .env.example
there's additional env variables that you need to define
or set the default to false
ok yea i see
BETTER_AUTH_SECRET=REPLACE_WITH_32_CHAR_SECRET
ok will set it all up now, thank youyou have other variables too .. if you read the function, you can figure out which ones' you need to set, hint: the github, apple, google, etc ones
ok this makes sense
good luck, I'm heading off to bed now.
read the code before you judge the element
good night and thanks a lot
yea will do
I’d recommend reading the Readme for a start. It’s not overly extensive (I just factored this code out of another project I am using Better Auth for), but it does contain a lot of the information you have been seeking, including the variables: https://github.com/Topfi/BetterAuth-Convex-9ui-shadcn-CLI-/blob/main/README.md
GitHub
BetterAuth-Convex-9ui-shadcn-CLI-/README.md at main · Topfi/Better...
🔐 A polished Better Auth + Convex setup with React 19 & Vite. Full auth flows (magic links, OTP, TOTP, social sign-in), strong security, styled UI, & realtime sync. Perfect for MVPs...
yea I read the readme twice now but it doesn’t say much about resend except that you can set the env for resend and that emails would work in production
i am now writing a helper so that logs happen on the server as that’s the only way vercel can see logs
because it’s unclear to me why resend logic would not activate
i don’t think i changed that part of the flow and left it as is
i only removed magic links to simplify as I just want to have OTP code sending
i also double checked that resend credentials are correct too so issue is not there
that’s for this issue https://discord.com/channels/1019350475847499849/1420203995540095108
the variables issue is solved, apologize for missing parts of the readme at the time
ok I think I know the cause of the bug now but it's unclear to me how the email
from
its sending from is chosen, shared more in https://discord.com/channels/1019350475847499849/1420203995540095108/1420304551906381836