Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround [dotenv] Load failed: file not found: File: '.env' #57

Open
lesnitsky opened this issue Mar 4, 2024 Discussed in #56 · 0 comments
Open

Workaround [dotenv] Load failed: file not found: File: '.env' #57

lesnitsky opened this issue Mar 4, 2024 Discussed in #56 · 0 comments
Labels
bug Something isn't working

Comments

@lesnitsky
Copy link
Member

For future readers:

package:dotenv tries to read .env file form the file system, but we only deploy dart executable without any files.
If you deploy from CLI, it will pick up your .env and prompt you to create env vars on Globe.
You could also go to Project > Settings > Environment variables and create env vars there manually.

To workaround this issue, you could do something like this:

var env = Platform.environment['GLOBE'] == 'true' ? Platform.environment : DotEnv().load();

We're working on fixing this issue and this workaround is temporary.

@lesnitsky lesnitsky added the bug Something isn't working label Mar 4, 2024
@lesnitsky lesnitsky changed the title [dotenv] Load failed: file not found: File: '.env' Workaround [dotenv] Load failed: file not found: File: '.env' Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant