Skip to content

Cannot use "export" feature of Nextjs with current ContentLayer config #426

@ashiishme

Description

@ashiishme

Hi team,

I was trying to setup Contentlayer to manage my posts content using the experimental app directory which now supports the static export.

The below config is required to support the export:

const nextConfig = {
 ...
  output: "export",
}

And the Contentlayer uses redirect property to hook into the application.

As state by the Nextjs, that the redirect config is not required for the static export. The application is failing.

And, I cannot use the Contentlayer for static export.

Is there any workaround to this?

To reproduce

  • Create a new Nextjs application and setup Contentlayer
  • Setup the next.config.js file to use Contentlayer config
  • Set output:"export" in your config
  • Run the application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions