-
Notifications
You must be signed in to change notification settings - Fork 194
Closed as not planned
Closed as not planned
Copy link
Labels
Milestone
Description
The error is non-fatal and still generates the documents.
Generated 9 documents in .contentlayer
TypeError: The "code" argument must be of type number. Received an instance of Object
at process.set [as exitCode] (node:internal/bootstrap/node:124:9)
at Cli.runExit (/home/xenfo/projects/website/node_modules/clipanion/lib/advanced/Cli.js:232:26)
at run (file:///home/xenfo/projects/website/node_modules/@contentlayer/cli/src/index.ts:39:3)
at main (/home/xenfo/projects/website/node_modules/contentlayer/bin/cli.cjs:5:3) {
code: 'ERR_INVALID_ARG_TYPE'
}
Contentlayer config:
import { defineDocumentType, makeSource } from 'contentlayer/source-files';
export const Post = defineDocumentType(() => ({
name: 'Post',
filePathPattern: 'posts/*.mdx',
contentType: 'mdx',
fields: {
title: {
type: 'string',
description: 'The title of the post',
required: true
},
description: {
type: 'string',
description: 'The description of the post',
required: true
},
publishedOn: {
type: 'date',
description: 'The publishing date of the post',
required: true
},
editedOn: {
type: 'date',
description: 'The editing date of the post',
required: true
},
status: {
type: 'enum',
description: 'The status of the post',
options: ['draft', 'published', 'edited'],
required: true
}
},
computedFields: {
slug: {
type: 'string',
description: 'The slug of the post',
resolve: (post) => post._raw.sourceFileName.replace(/\.mdx?$/, '')
}
}
}));
export default makeSource({
contentDirPath: 'data',
contentDirExclude: ['themes'],
documentTypes: [Post]
});brunowego, benbjurstrom, goustaff, schardev, kachkaev and 3 more