contentlayerdev / contentlayerdev/contentlayer

Runtime config / schema validation

Open
#214 3 comments 3 reactions 0 assignees View on GitHub
meta: never-stale topic: error-handling
Dominant language
TypeScript
Stars
3.5k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

Some users (typically users who don't yet use TypeScript) are running into problems due to misconfigurations of their Contentlayer config (especially in regards to the content schema). Additionally to the safety provided by TypeScript, we should also implement a runtime validation step to avoid undefined runtime errors.

## Technical notes

Ideally we should figure out a way how to derive [Zod](https://github.com/colinhacks/zod)-like validation logic based on the existing TypeScript definitions. We could also investigate to use [TS+](https://github.com/ts-plus) for this.

## Related issues

- https://github.com/contentlayerdev/contentlayer/issues/193

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.