99x / serverless-react-boilerplate

A serverless react boilerplate for offline development
MIT License
260 stars 75 forks source link

Environmental variables are not properly loading in Lambda #32

Closed AshanFernando closed 7 years ago

AshanFernando commented 7 years ago

Environmental variables are not properly loading in Lambda with serverless-plugin-write-env-vars

serverless-plugin-write-env-vars users dotenv npm internally and creates .env file in serverless deploy stage so that it bundles inside the zip for deployment. However dotenv requires to run the following code as early as possible in the application at execution.

require('dotenv').config();

reference: https://www.npmjs.com/package/dotenv

mjzone commented 7 years ago

Thanks @AshanFernando 🎇