NODE_ENV is undefined in lambda functions no matter what I do

Jon has as usual done an incredible job of providing a very similar answer to the one Netlify’s staff would have. The “missing piece” is one we’re working on writing up right now - TL;DR we only automatically “forward” environment variables from our UI, NOT from netlify.toml (nor automatically set like “$COMMIT_REF”), to functions. The plugin Jon linked is a good way to get there, or you can manually interpolate the variables as explained in this article:

1 Like