contentlayerdev / contentlayerdev/website

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

Ouverte
#105 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
132
Forks
57
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

```json
"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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with the official Getting Started example and its package.json build script, then reproduce the CI failure in an environment without .contentlayer. Check whether the documented build command needs Contentlayer to run first; done means the example builds successfully and the documentation reflects the required command or confirmed supported behavior.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
next.js, typescript
Domaine
build-system, documentation
Type d'issue
Documentation
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.