Commit f8cbbb1
Deepak Pandey
Fix OPENROUTER_API_KEY build error - move environment variable check to runtime
- Fixed app/api/ai/route.ts: Moved OPENROUTER_API_KEY check from module level to inside callOpenRouterAPI function
- This prevents build-time errors when environment variables are not available
- Build now passes successfully with 142/142 pages generated
- All environment variable checks now happen at runtime, not build time1 parent 91f088f commit f8cbbb1
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 73 | | |
79 | 74 | | |
80 | 75 | | |
| |||
84 | 79 | | |
85 | 80 | | |
86 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
0 commit comments