Skip to content

在创建了.env文件后,运行flutter pub run build_runner build --delete-conflicting-outputs报错 #3

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

Closed
AChaoZJU opened this issue Mar 1, 2025 · 0 comments

Comments

@AChaoZJU
Copy link

AChaoZJU commented Mar 1, 2025

An exmaple .env

## 根据你的需要配置
OPENAI_API_KEY=sk-aaaaaaaaaaaa
HTTP_PROXY=http://localhost:7890
BASE_URL=https://openai.mignsin.workers.dev/v1

➜ chatgpt_book_code git:(chapter-4) ✗ flutter pub run build_runner build --delete-conflicting-outputs

Deprecated. Use `dart run` instead.
[INFO] Generating build script...
[INFO] Generating build script completed, took 380ms
[INFO] Reading cached asset graph completed, took 122ms
[INFO] Checking for updates since last build completed, took 943ms
[INFO] Running build completed, took 20ms
[INFO] Caching finalized dependency graph completed, took 97ms
[SEVERE] envied_generator:envied on lib/env.dart (cached):

Environment variable not found for field `apiKey`.
package:chatgpt/env.dart:8:16
  ╷
8 │   static const apiKey = _Env.apiKey;
  │                ^^^^^^
  ╵
[SEVERE] Failed after 131ms
Failed to update packages.
➜  chatgpt_book_code git:(chapter-4) ✗ 
➜  chatgpt_book_code git:(chapter-4) ✗ flutter pub run build_runner build --delete-conflicting-outputs
Deprecated. Use `dart run` instead.
[INFO] Generating build script completed, took 373ms
[INFO] Reading cached asset graph completed, took 124ms
[INFO] Checking for updates since last build completed, took 909ms
[INFO] Running build completed, took 21ms
[INFO] Caching finalized dependency graph completed, took 94ms
[SEVERE] envied_generator:envied on lib/env.dart (cached):

Environment variable not found for field `apiKey`.
package:chatgpt/env.dart:8:16
  ╷
8 │   static const apiKey = _Env.apiKey;
  │                ^^^^^^
  ╵
[SEVERE] Failed after 129ms
@AChaoZJU AChaoZJU closed this as completed Mar 1, 2025
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

1 participant