Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler.
You can no longer do:
export const blogLandingPageContent = await sanityClient.fetch(
groq`*[ _type == "page" && pageType == "blog-landing" ][0]${pathProjection}`
);
Instead:
const blogLandingPageContent = await sanityClient.fetch(
groq`*[ _type == "page" && pageType == "blog-landing" ][0]${pathProjection}`
);
From:
astro build && wrangler deploy --env=”staging”
To:
CLOUDFLARE_ENV=stating astro build && wrangler deploy