`process.env.NODE_ENV` returning an unexpected value
I have my dev deployment configured to have
NODE_ENV=wissam
, however, when I run console.log(process.env.NODE_ENV)
the result is development
3 Replies
Do you have NODE_ENV set in your convex dev deployment?
Oh, here's your answer: https://discord.com/channels/1019350475847499849/1178924136010088489/1178936731475644488
(it's hardcoded to "development" for right now)
Yes it is set. ok roger that, so it's a feature not a bug, understood.
btw this is a byproduct of convex using esbuild to bundle code. esbuild replaces occurrences of
process.env.NODE_ENV
with 'development'
in source code. So as far as the convex runtime is concerned, it's not an env variable anymore, it's a string. https://esbuild.github.io/api/#platform