-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
astro:env
public variables should not be checked during sync
#11281
Comments
|
astro:env
astro:env
public variables should not be checked during sync
Hello @Trombach. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
I think this is because we check the variables during |
Thanks for looking into this @Princesseuh and @florian-lefebvre. Yes, I have noticed that |
@florian-lefebvre I've added a stackblitz to the description |
Sounds ok to me, but I'm not sure how to get that info from a plugin. The way we usually handle types file generation though is directly in the sync command: astro/packages/astro/src/core/sync/index.ts Lines 82 to 89 in e67d7e6
So perhaps we should move the env generation there? And the plugin shouldn't be generating any files. |
Describe the Bug
I'm not sure if it's best to report here or if this is an issue with
astro:env
.I've moved my environment setup to
astro:env
and noticed that my Github action runningastro-check
started failing. An example can be found here. I would expect forastro-check
to only infer the type of my defined variable, but not to require the variables to actually be set.It's easy enough to work around by just setting the environment variables to something, but it would be nice if we didn't have to for simple CI checks like this.
Steps to Reproduce
npm init astro
envField
to astro.config, e.g.npm run astro check
The following environment variables do not match the data type and/or properties defined in
experimental.env.schema
:Variable PUBLIC_VARIABLE is not of type: string.
Minimal reproduction
https://stackblitz.com/~/github.com/Trombach/astro-check-test
The text was updated successfully, but these errors were encountered: