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

This package doesn't seem to work for a dart cli #35

Open
duck-dev-go opened this issue Jan 5, 2023 · 1 comment
Open

This package doesn't seem to work for a dart cli #35

duck-dev-go opened this issue Jan 5, 2023 · 1 comment

Comments

@duck-dev-go
Copy link

As soon as you build an executable for your dart cli and run that executable from the terminal. It can't find the .env file and throws the following error

[dotenv] Load failed: file not found: File: 'production.env'

@alexrintt
Copy link

This package only load the host machine environment and/or a external environment file that must be available on the host machine at runtime.

If you are looking for bundling your environment variables in production, you need to define it when compiling your binary.

To specify an environment declaration when running or compiling a Dart application, use the --define option or its abbreviation, -D. Specify the declaration key-value pair using a = format:

dart run --define=DEBUG=true -DFLAVOR=free

See: https://dart.dev/guides/environment-declarations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants