Bref: Symfony Dotenv->bootEnv() error

Created on 19 Dec 2020  路  7Comments  路  Source: brefphp/bref

Hello all,

Since the new releases I'm encoutering issues with loading the environment variables, specifically with Symfony Dotenv.

By following this guide: https://bref.sh/docs/frameworks/symfony.html
The Lambda gives us the following errors:
image

Not sure why it's looking for the .env file but I assume it has something to do with the recent update on serverless .env file support. https://www.serverless.com/framework/docs/deprecations/#LOAD_VARIABLES_FROM_ENV_FILES

Hope this contributes.

bug

All 7 comments

Same here .env is not read by laravel when deployed using sls deploy

Thanks, it seems to be caused by https://github.com/serverless/serverless/pull/8634 (a change in serverless). I'll post a comment there.

If someone else is encountering this problem, you can simply downgrade serverless to 2.15.0 by running the following command and your application should be good to go again:
npm install -g [email protected]

If someone else is encountering this problem, you can simply downgrade serverless to 2.15.0 by running the following command and your application should be good to go again:
npm install -g [email protected]

Thank you for the quick workaround !

put this in your serverless.yml file

package:
include: ".env*"

https://github.com/serverless/serverless/pull/8648#discussion_r546710547

Thanks to @mnapoli they are discussing the .env file as a need for the framework rather than its need for the lambda itself until then the above should work

I think https://github.com/serverless/serverless/pull/8648 solves this issue for now (you need to upgrade serverless), should we close this?

Seems fair right. Maybe update the documentation though?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

t-geindre picture t-geindre  路  4Comments

anandvns picture anandvns  路  8Comments

nealio82 picture nealio82  路  6Comments

tlfbrito picture tlfbrito  路  4Comments

mnapoli picture mnapoli  路  4Comments