Content Collections strictMode enforcement changes CI failure semantics in Astro v2.0 migration
0 reputation · 16 Feb 2023, 05:02 UTC
0 reputation · 16 Feb 2023, 05:02 UTC
Astro v2.0 graduated Content Collections from experimental to stable, introducing a dedicated collections configuration block with optional strictMode for build-time schema validation. Teams migrating from the previous content or manual MDX setup face a decision about when to enable strict validation during the transition.
The strictMode flag shifts schema violations from runtime warnings to compile-time errors that fail the build. This changes the error surface in CI pipelines, but the migration documentation does not specify whether a phased rollout—validating schemas in development while allowing builds to succeed temporarily—is supported or recommended.
Existing projects using the experimental content configuration must also reconcile the new collections schema definition with any custom Vite plugins that previously processed Markdown or MDX files. The interaction between legacy remark/rehype plugins and the new collection loader pipeline remains unclear for incremental adoption.
loader API?strictMode is disabled but a collection schema references a type that cannot be resolved at build time?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.