fix: read env vars from process.env for K8s compatibility
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 57s
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 57s
Astro import.meta.env doesn't see K8s configmap env vars. Fall back to process.env which works in SSR Node runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6782e4d40b
commit
e14732ef2c
@ -2,8 +2,8 @@ import { createClient } from '@sanity/client'
|
|||||||
import imageUrlBuilder from '@sanity/image-url'
|
import imageUrlBuilder from '@sanity/image-url'
|
||||||
|
|
||||||
export const sanity = createClient({
|
export const sanity = createClient({
|
||||||
projectId: import.meta.env.SANITY_PROJECT_ID,
|
projectId: process.env.SANITY_PROJECT_ID || import.meta.env.SANITY_PROJECT_ID,
|
||||||
dataset: import.meta.env.SANITY_DATASET || 'production',
|
dataset: process.env.SANITY_DATASET || import.meta.env.SANITY_DATASET || 'production',
|
||||||
apiVersion: '2024-01-01',
|
apiVersion: '2024-01-01',
|
||||||
useCdn: false,
|
useCdn: false,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user