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

Changes in .env file does not update generated env files #6

Closed
lordvidex opened this issue Aug 20, 2022 · 13 comments
Closed

Changes in .env file does not update generated env files #6

lordvidex opened this issue Aug 20, 2022 · 13 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@lordvidex
Copy link

BEFORE

.env

SECRET=abc

env.g.dart

class _Env {
  static const secret = 'abc';
}

AFTER

.env

SECRET=def
 $ flutter pub run build_runner build --delete-conflicting-outputs 

env.g.dart

class _Env {
  static const secret = 'abc';
}
@petercinibulk
Copy link
Owner

Thanks for reporting this! I will need to do some digging into this one to see if there is any clever fix. This was still a problem with Envify, which this package is based on. For now the best piece of advice is to run flutter clean and then run the generator. I'm hoping there is a fix with the build or source_gen package to force a rebuild but I will have to do some searching.

@petercinibulk petercinibulk added the bug Something isn't working label Aug 21, 2022
@techouse
Copy link
Collaborator

If this happens simply run

flutter pub run build_runner clean

which will clean all the generated files and purge the code-gen caches. Then run

flutter pub run build_runner build --delete-conflicting-outputs

as you normally would.

@isaacadariku

This comment was marked as spam.

@diegog-sf

This comment was marked as spam.

@diegog-sf

This comment was marked as spam.

@petercinibulk
Copy link
Owner

This is something that the build library does not currently support. I am tracking this issue: dart-lang/build#967 If you know of a creative workaround you can make a pull request and I'd gladly review it! :)

@Meshkat-Shadik

This comment was marked as spam.

@affansk

This comment was marked as spam.

@Ali1Ammar

This comment was marked as spam.

@Ali1Ammar

This comment was marked as spam.

@techouse techouse added enhancement New feature or request help wanted Extra attention is needed labels Aug 26, 2023
@Ali1Ammar

This comment was marked as spam.

@mizukami2005

This comment was marked as spam.

@techouse
Copy link
Collaborator

I'm closing this issue as the root cause dart-lang/build#967 lies outside of this package and because a workaround has been provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants