And I have a .env in the root folder (from where the lambda is started, using netlify-lambda serve src/functions)
But in my TS lambda file, my process.env.SOME_VAR variables don't get properly replaced, instead they get process && process.env && process.env.SOME_VAR || undefined.
But if somewhere I add a console.log(process.env.SOME_VAR), it fixes them all!
It also fixes the issue if I replace "inline-dotenv" with ["inline-dotenv", {}] in .babelrc...
Note that BABEL_DISABLE_CACHE=1 does not help.
I'm using this plugin for my typescript lambda functions. So, in my functions folder, I have a
.babelrc
with:And I have a
.env
in the root folder (from where the lambda is started, usingnetlify-lambda serve src/functions
)But in my TS lambda file, my
process.env.SOME_VAR
variables don't get properly replaced, instead they getprocess && process.env && process.env.SOME_VAR || undefined
. But if somewhere I add aconsole.log(process.env.SOME_VAR)
, it fixes them all! It also fixes the issue if I replace"inline-dotenv"
with["inline-dotenv", {}]
in.babelrc
... Note thatBABEL_DISABLE_CACHE=1
does not help.