Skip to content

next.js build: building contentlayer prior to TSC or adding more clear docs #105

Open
@jzxhuang

Description

@jzxhuang

When following the official Getting Started example for Next.js, the app fails to build on CI or any environemnt where .contentlayer doesn't exist already.

This appears to be because TSC runs prior to contentlayer, which errors out.

I'm not sure if this can be changed at all (to run a Next plugin prior to the TSC step). That would seem like the ideal solution, but otherwise, would be great to update the documentation & examples to modify the build step

"scripts": {
  "build": "contentlayer && next build"
}

I'm happy to make a PR to help out, just wanted to check if this is indeed an issue that others experience or if I'm really missing something basic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions