Next.js Discord

Discord Forum

Contentlayer causes build errors

Unanswered
Minskin posted this in #help-forum
Open in Discord
MinskinOP
When I'm trying to implement contentlayer in my nextjs app, I'm facing build errors:
"web:build: TypeError: Cannot destructure property 'ConnectionOptionsReader' of 'i(...)' as it is undefined."

It mainly happens when I'm adding the following (which is necessary) in next.config.js:

const { withContentlayer } = require("next-contentlayer");

const nextConfig = {
.......code here..........
}

module.exports = withContentlayer(nextConfig);

How do i solve this?

0 Replies