If you've been working with Next.js in the last year, you've probably noticed a significant shift in how developers handle markdown and MDX content. For a long time, Contentlayer was the undisputed champion. It provided a fantastic developer experience with auto-generated TypeScript types, hot-reloading, and seamless integration with Next.js.
However, as Next.js evolved, Contentlayer unfortunately fell behind.
The Problem with Contentlayer
The most glaring issue with Contentlayer today is its lack of maintenance. It still enforces strict peer dependencies on older versions of Next.js, meaning that if you try to build a modern Next.js 15 application, npm will throw ERESOLVE errors immediately during installation.
While you can bypass this with npm i --legacy-peer-deps or package overrides, it's not a sustainable long-term solution. You're effectively building your modern framework on top of an abandoned foundation.
Other issues included:
- Incompatible with Turbopack.
- Bugs that were never addressed in the open-source repository.
- Lack of ongoing support for App Router specific paradigms.
Enter Content Collections
This is where Content Collections steps in. It is widely considered the spiritual successor to Contentlayer, taking all of the good ideas and rebuilding them with modern tools.

What makes it better?
- Powered by Zod: Under the hood, Content Collections uses Zod for type validation. This means your frontmatter is strictly validated, and your auto-generated TypeScript types are exact. You can even write robust validation logic (like enforcing that if
draftis false, anauthormust exist). - Speed: It uses SWC (the same super-fast Rust compiler that Next.js uses) to parse and compile your content.
- Turbopack Support: It works seamlessly with Next.js Turbopack, providing almost instant reloads when you change your MDX files.
- Clean API: The syntax is almost identical to Contentlayer, making migrations incredibly straightforward.
The Migration Experience
Migrating a codebase from Contentlayer to Content Collections is simple. You swap out the dependencies, restructure your schema slightly, and update your imports from contentlayer/generated to content-collections.
Your React components stay exactly the same. The data structure stays the same. You just get a faster, maintained, and type-safe engine under the hood.
If you are starting a new Next.js project today, or if you are tired of dealing with peer dependency errors in your legacy applications, Content Collections is absolutely the way to go.