Skip to content

Commit 7c5863a

Browse files
committed
keep env var check
1 parent 2ebacb6 commit 7c5863a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/dev/src/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ export class NetlifyDev {
473473
this.#cleanupJobs.push(() => runtime.stop())
474474

475475
// Check if AI Gateway is disabled at account level
476-
if (this.#features.aiGateway && config?.accounts) {
476+
if (this.#features.aiGateway && this.#features.environmentVariables && config?.accounts) {
477477
type AccountWithCapabilities = {
478478
slug?: string
479479
capabilities?: { ai_gateway_disabled?: { included?: boolean } }
@@ -487,7 +487,13 @@ export class NetlifyDev {
487487
}
488488

489489
// Bootstrap AI Gateway: Fetch AI Gateway tokens and inject them into env
490-
if (this.#features.aiGateway && config?.api && siteID && config?.siteInfo?.url) {
490+
if (
491+
this.#features.aiGateway &&
492+
this.#features.environmentVariables &&
493+
config?.api &&
494+
siteID &&
495+
config?.siteInfo?.url
496+
) {
491497
await setupAIGateway({
492498
api: config.api,
493499
env: config.env || {},

0 commit comments

Comments
 (0)