Skip to content
Discussion options

You must be logged in to vote

If your environment variable is referenced during analysis or prerendering for a build (typically at the top level of a server file), you'll want to guard its access with if (!building) https://svelte.dev/docs/kit/$app-env#building to prevent it from being evaluated

#16267 will probably make this more noticeable since you'll have to specify if your environment variable is runtime only, build only, etc.

Replies: 14 comments 20 replies

Comment options

You must be logged in to vote
1 reply
@cotyhamilton
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@miguelvalente
Comment options

@Neo-Ciber94
Comment options

Comment options

You must be logged in to vote
3 replies
@iaingalloway
Comment options

@fjukstad
Comment options

@iaingalloway
Comment options

Comment options

You must be logged in to vote
5 replies
@DougAnderson444
Comment options

@DougAnderson444
Comment options

@shahin-salehi
Comment options

@SFGMorales
Comment options

@Neo-Ciber94
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@noboomu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@Rich-Harris
Comment options

@Rich-Harris
Comment options

@Rich-Harris
Comment options

@anly2
Comment options

@Rich-Harris
Comment options

Answer selected by teemingc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment