-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Astro Info
Astro v5.10.0
Node v24.2.0
System macOS (arm64)
Package Manager npm
Output static
Adapter none
Integrations @astrojs/sitemap
astro-robots-txt
astro-icon
astro-purgecss
astro-html-optimizer
@playform/inline
@playform/compress
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Hello,
I've encountered what appears to be an inconsistency in how CLI commands handle configuration validation errors. When a command fails due to a Zod configuration validation error, it returns an exit code of 0 (indicating success) rather than a non-zero error code.
This behavior became problematic in my CI pipeline, which consists of two sequential steps:
- Type generation via
npx astro sync - ESLint execution with type-dependent rules
During a recent Astro upgrade, my configuration contained an invalid experimental feature (experimental.responsiveImages). While this triggered a configuration validation error in step 1, the successful exit code allowed the pipeline to proceed to step 2, which then failed due to missing type definitions that should have been generated in the previous step.
This created a misleading error trail that significantly complicated debugging, as the root cause (configuration validation failure) was masked by the downstream effects (ESLint failures due to missing types).
While this may be an intentional design choice, it strikes me as potentially unintended behaviour that could benefit from reconsideration.
What's the expected result?
When a CLI command fails due to a Zod configuration validation error, return exit code != 0
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.