Fields of type 'list' break everything but 'json' and 'string' work
See original GitHub issueIβm busy trying to implement Contentlayers on a site with a lot of mdx files as the content for a blog. When I use the type: 'list'
property in a field everything breaks.
`This error shouldnβt have happened. Please consider opening a GitHub issue with the stack trace below here: https://github.com/contentlayerdev/contentlayer/issues
β₯ β βββ¦βββ β β β β β β βAn interrupt was produced by #16. β β β β β βΌ β β β β βAn unchecked error was produced. β β β β TypeError: Cannot read properties of undefined (reading βtypeβ) β β at fieldListItemsToCoreFieldListDefItems (file:///workspace/avif.io/node_modules/@contentlayer/source-files/src/schema/provideSchema.ts:251:28) β β at fieldDefEntryToCoreFieldDef (file:///workspace/avif.io/node_modules/@contentlayer/source-files/src/schema/provideSchema.ts:159:13) β β at file:///workspace/avif.io/node_modules/@contentlayer/source-files/src/schema/provideSchema.ts:26:9 β β at Array.map (<anonymous>) β β at next (file:///workspace/avif.io/node_modules/@contentlayer/source-files/src/schema/provideSchema.ts:25:64) β β at Generator.next (<anonymous>) β β at ISuspend.factory (file:///workspace/avif.io/node_modules/@effect-ts/system/_src/Effect/gen.ts:135:28) β β at FiberContext.evaluateNow (file:///workspace/avif.io/node_modules/@effect-ts/system/_src/Fiber/context.ts:1173:51) β β at file:///workspace/avif.io/node_modules/@effect-ts/system/_src/Fiber/context.ts:576:33 β β at file:///workspace/avif.io/node_modules/@effect-ts/system/_src/Support/Scheduler/index.ts:15:9 β β β β Fiber: #18 (started at: 2022-04-24T14:08:00.132Z) was supposed to continue to: β β β β a future continuation at packages/@contentlayer/source-files/src/index.ts:104:19 β β β β Fiber: #18 (started at: 2022-04-24T14:08:00.132Z) Execution trace: β β β β packages/@contentlayer/source-files/src/schema/provideSchema.ts:18:8 β β β β Fiber: #18 (started at: 2022-04-24T14:08:00.132Z) was spawned by: β β β β Fiber: #16 (started at: 2022-04-24T14:08:00.132Z) was supposed to continue to: β β β β a future continuation at packages/@contentlayer/core/src/generation/generate-dotpkg.ts:82:13 β β β β Fiber: #16 (started at: 2022-04-24T14:08:00.132Z) Execution trace: β β β β packages/@contentlayer/core/src/generation/generate-dotpkg.ts:78:16 β β β β Fiber: #16 (started at: 2022-04-24T14:08:00.132Z) was spawned by: β β β β Fiber: #14 (started at: 2022-04-24T14:08:00.129Z) was supposed to continue to: <empty trace> β β β β Fiber: #14 (started at: 2022-04-24T14:08:00.129Z) Execution trace: <empty trace> β β β β Fiber: #14 (started at: 2022-04-24T14:08:00.129Z) was spawned by: β β β β Fiber: #10 (started at: 2022-04-24T14:08:00.128Z) was supposed to continue to: <empty trace> β β β β Fiber: #10 (started at: 2022-04-24T14:08:00.128Z) Execution trace: <empty trace> β β β β Fiber: #10 (started at: 2022-04-24T14:08:00.128Z) was spawned by: β β β β Fiber: #3 (started at: 2022-04-24T14:07:59.958Z) was supposed to continue to: <empty trace> β β β β Fiber: #3 (started at: 2022-04-24T14:07:59.958Z) Execution trace: β β β β packages/next-contentlayer/src/plugin.ts:17:94 β β packages/@contentlayer/utils/src/effect/Stream.ts:32:83 β β packages/@contentlayer/core/src/getConfig/index.ts:192:13 β β packages/@contentlayer/core/src/getConfig/index.ts:181:28 β β packages/@contentlayer/core/src/getConfig/index.ts:179:44 β β packages/@contentlayer/core/src/getConfig/index.ts:166:28 β β packages/@contentlayer/core/src/getConfig/index.ts:164:31 β β packages/@contentlayer/core/src/getConfig/index.ts:151:28 β β packages/@contentlayer/core/src/getConfig/index.ts:149:15 β β packages/@contentlayer/core/src/getConfig/index.ts:146:15 β β packages/@contentlayer/core/src/getConfig/index.ts:145:15 β β packages/@contentlayer/core/src/cwd.ts:24:43 β β packages/@contentlayer/core/src/getConfig/index.ts:134:27 β β packages/@contentlayer/core/src/getConfig/index.ts:121:10 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:118:12 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:121:14 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:70:15 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:69:10 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:68:10 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:51:22 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:76:10 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:75:12 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:75:46 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:89:20 β β packages/@contentlayer/core/src/getConfig/esbuild.ts:88:12 β β β β Fiber: #3 (started at: 2022-04-24T14:07:59.958Z) was spawned by: β β β β Fiber: #0 (started at: 2022-04-24T14:07:59.943Z) was supposed to continue to: <empty trace> β β β β Fiber: #0 (started at: 2022-04-24T14:07:59.943Z) Execution trace: β β β β packages/@contentlayer/utils/src/tracing-effect/index.ts:45:45 β β packages/@contentlayer/core/src/cwd.ts:22:49 β β packages/@contentlayer/core/src/cwd.ts:9:18 β β packages/@contentlayer/core/src/cwd.ts:8:23 β β packages/@contentlayer/core/src/cwd.ts:7:29 β β packages/@contentlayer/core/src/runMain.ts:23:32 β β packages/@contentlayer/core/src/runMain.ts:14:12 β β β β Fiber: #0 (started at: 2022-04-24T14:07:59.943Z) was spawned by: <empty trace> β βΌ βΌ
OS: linux 5.16.20-051620-generic (arch: x64) Process: /home/gitpod/.nvm/versions/node/v16.14.2/bin/node /workspace/avif.io/node_modules/.bin/next dev Node version: v16.14.2 Contentlayer version: 0.2.4`
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top GitHub Comments
Sorry about the confusion in case you ran into a problem like described above. This isnβt technically a problem with Contentlayer itself but rather occurs when βwrongly using itβ. (Thanks @sidwebworks for pointing out the solution to the described problem.)
In order to improve the DX for future users running into a similar situation, Iβm planning to implement Runtime config / schema validation functionality (see #214).
You need to add the
of
property in the field