Show full output of t3env
This might be hard to improve, but if the
convex dev
command were able to show the rest of T3 env's output, it'd make troubleshooting missing env vars easier, b/c the terminal only gives this level of detail (whereas T3's log output includes the names of the missing env variables):
3 Replies
Oh interesting, do you know where the output goes? Is it in the error message or or stderr or stdout?
I'd love to get this right, something like t3env would be really valuable
and if that can just be t3env, perfect
T3's message is logged via
console.error()
:
https://github.com/t3-oss/t3-env/blob/92d2966dfecbb0d99e6e37be2b01a161a2d6d069/packages/core/src/index.ts#L378
And here is an example console log that I expect to see from T3 env when it can't find a required env var; this example is my vite-based Tanstack app:
Maybe Convex's dev server or ESBuild uses try/catch and re-throws somewhere?
Here is a simple way to reproduce:
Then use somewhere in code in the convex
dir:
Cool, I can also reproduce with a convex/myFunctions.ts like
which gives me
and on the local backend I see
Seems like pushing code to a convex deployment that sends you console.log() messages found during analyze should collect and print the logs, at least on failure. We can probably do that, we've got them, but don't report them (as is apparent from
Unexpected Console access at import time: 'this is some error information' instance_name="carnitas"
)