thread about NODE_ENV
Happy to hop on a quick call and walk you through it or move it to DM to save this channel
10 Replies
here's a thread to save the channel
I literally modified one of my existing queries in convex/ to also
console.log(process.env.NODE_ENV)
then deployed it to prod (we're not taking real traffic yet) and ran that query from the functions dashboard, it printed log development
Great, thanks!
yeah, you are right, I can repro
Thanks for the report.
definitely. If you guys do end up supporting it, would certainly be useful.
just please confirm when you rule it out from affecting any convex services 🙂
We've ruled this out affecting anything with Convex services. It looks like this is default esbuild behavior, the bundler used before sending code to Convex.
Not only does the bundler set
NODE_ENV
, it overrides any value set for it in the environment variables panel. Just discovered this trying to limit cron jobs to prod. I'll use ENVIRONMENT
or CONVEX_ENV
, both of which make more sense becuase most convex code isn't running in node anyway, but just a heads up. Probably docs worthy.good to know about
CONVEX_ENV
, if this is supported by not documented, would be good to get an official wordNote that
CONVEX_ENV
is just an example that erquhart came up with, you'd have to set that yourself.Ah ok. Wasn't clear