In envied_generator/lib/src/load_envs.dart, the .env is loaded CWD-relative:
final File file = File.fromUri(Uri.file(path)); // 'path' defaults to '.env'
In a Dart pub workspace, dart run build_runner build --workspace runs from the repo root, so .env resolves to <root>/.env instead of the package's .env, and generation fails:
Environment variable not found for field `apiUrl`.
(@Envied(path: '.env') doesn't help — that's already the default.)
Expected: resolve .env relative to the annotated class's package (e.g. via buildStep + AssetId), so workspace and package-local builds behave the same.
Env: envied 1.3.5, build_runner 2.15.0, Dart 3.11.5.
In
envied_generator/lib/src/load_envs.dart, the.envis loaded CWD-relative:In a Dart pub workspace,
dart run build_runner build --workspaceruns from the repo root, so.envresolves to<root>/.envinstead of the package's.env, and generation fails:(
@Envied(path: '.env')doesn't help — that's already the default.)Expected: resolve
.envrelative to the annotated class's package (e.g. viabuildStep+AssetId), so workspace and package-local builds behave the same.Env: envied 1.3.5, build_runner 2.15.0, Dart 3.11.5.