Are environment variables available at build or only runtime?

My SvelteKit builds fail when I use import { SECRET } from '$env/static/private' or the public equivalent ($env/static/public) with an error such as:
RollupError: "SECRET" is not exported by "virtual:$env/static/private"

However accessing environment variables via import { env } from '$env/dynamic/private'; works.

Is it correct to assume environment variables created on Cloudflare Pages are only available at runtime?
Was this page helpful?