Skip to content

Bumping from 0.2.7 to 0.2.8 breaks with Cannot read properties of undefined (reading 'name') #306

Closed

Description

@marcofranssen

When bumping contentlayer from 0.2.7 to 0.2.8 I get the following error. 0.2.7 just works fine. Running with next 12.2.5 on node 16.

$ yarn dev
yarn run v1.22.19
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /Users/marco/code/priv/nextjs-blog/.env
info  - SWC minify release candidate enabled. https://nextjs.link/swcmin
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 unchecked error was produced.

TypeError: Cannot read properties of undefined (reading 'name')
    at IncompatibleFieldDataError.renderLine (file:///Users/marco/code/priv/nextjs-blog/node_modules/@contentlayer/source-files/src/errors/index.ts:353:74)
    at file:///Users/marco/code/priv/nextjs-blog/node_modules/@contentlayer/source-files/src/errors/aggregate.ts:133:31
    at Array.map (<anonymous>)
    at aggregateFetchDataErrors (file:///Users/marco/code/priv/nextjs-blog/node_modules/@contentlayer/source-files/src/errors/aggregate.ts:133:8)
    at next (file:///Users/marco/code/priv/nextjs-blog/node_modules/@contentlayer/source-files/src/errors/aggregate.ts:34:26)
    at Generator.next (<anonymous>)
    at ISuspend.factory (file:///Users/marco/code/priv/nextjs-blog/node_modules/@effect-ts/system/_src/Effect/gen.ts:135:28)
    at FiberContext.evaluateNow (file:///Users/marco/code/priv/nextjs-blog/node_modules/@effect-ts/system/_src/Fiber/context.ts:1173:51)
    at file:///Users/marco/code/priv/nextjs-blog/node_modules/@effect-ts/system/_src/Fiber/context.ts:576:33
    at file:///Users/marco/code/priv/nextjs-blog/node_modules/@effect-ts/system/_src/Support/Scheduler/index.ts:15:9

Fiber: #28 (started at: 2022-09-14T08:31:19.936Z) was supposed to continue to:

  a future continuation at packages/@contentlayer/source-files/src/fetchData/index.ts:102:21

Fiber: #28 (started at: 2022-09-14T08:31:19.936Z) Execution trace:

  packages/@contentlayer/source-files/src/errors/aggregate.ts:27:8
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:74:15
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:139:37
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:134:8
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:72:43
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:68:16
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:67:16
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:56:24
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:53:49
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:122:10
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:118:22
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:47:44
  packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts:46:10

Fiber: #28 (started at: 2022-09-14T08:31:19.936Z) was spawned by:

Fiber: #24 (started at: 2022-09-14T08:31:19.935Z) was supposed to continue to: <empty trace>

Fiber: #24 (started at: 2022-09-14T08:31:19.935Z) Execution trace: <empty trace>

Fiber: #24 (started at: 2022-09-14T08:31:19.935Z) was spawned by:

Fiber: #23 (started at: 2022-09-14T08:31:19.935Z) was supposed to continue to: <empty trace>

Fiber: #23 (started at: 2022-09-14T08:31:19.935Z) Execution trace: <empty trace>

Fiber: #23 (started at: 2022-09-14T08:31:19.935Z) was spawned by:

Fiber: #22 (started at: 2022-09-14T08:31:19.924Z) was supposed to continue to: <empty trace>

Fiber: #22 (started at: 2022-09-14T08:31:19.924Z) Execution trace:

  packages/@contentlayer/source-files/src/fetchData/index.ts:54:116
  packages/@contentlayer/utils/src/node/fs.ts:90:15
  packages/@contentlayer/utils/src/node/fs.ts:89:72
  packages/@contentlayer/utils/src/node/fs.ts:89:12
  packages/@contentlayer/utils/src/node/fs.ts:17:10
  packages/@contentlayer/utils/src/node/fs.ts:16:60
  packages/@contentlayer/utils/src/node/fs.ts:16:15
  packages/@contentlayer/utils/src/node/fs.ts:31:27
  packages/@contentlayer/core/src/DataCache.ts:51:31
  packages/@contentlayer/core/src/DataCache.ts:50:17
  packages/@contentlayer/core/src/ArtifactsDir.ts:31:12
  packages/@contentlayer/core/src/cwd.ts:23:43
  packages/@contentlayer/utils/src/node/version.ts:21:15
  packages/@contentlayer/utils/src/node/version.ts:20:10
  packages/@contentlayer/utils/src/node/fs.ts:77:17
  packages/@contentlayer/utils/src/node/fs.ts:76:12
  packages/@contentlayer/utils/src/node/fs.ts:45:22
  packages/@contentlayer/core/src/ArtifactsDir.ts:27:15
  packages/@contentlayer/core/src/DataCache.ts:47:38
  packages/@contentlayer/core/src/DataCache.ts:46:12

Fiber: #22 (started at: 2022-09-14T08:31:19.924Z) was spawned by:

Fiber: #17 (started at: 2022-09-14T08:31:19.916Z) was supposed to continue to: <empty trace>

Fiber: #17 (started at: 2022-09-14T08:31:19.916Z) Execution trace:

  packages/@contentlayer/core/src/cwd.ts:23:43
  packages/@contentlayer/core/src/generation/generate-dotpkg.ts:82:13
  packages/@contentlayer/core/src/generation/generate-dotpkg.ts:78:16

Fiber: #17 (started at: 2022-09-14T08:31:19.916Z) was spawned by:

Fiber: #15 (started at: 2022-09-14T08:31:19.914Z) was supposed to continue to: <empty trace>

Fiber: #15 (started at: 2022-09-14T08:31:19.914Z) Execution trace: <empty trace>

Fiber: #15 (started at: 2022-09-14T08:31:19.914Z) was spawned by:

Fiber: #11 (started at: 2022-09-14T08:31:19.913Z) was supposed to continue to: <empty trace>

Fiber: #11 (started at: 2022-09-14T08:31:19.913Z) Execution trace: <empty trace>

Fiber: #11 (started at: 2022-09-14T08:31:19.913Z) was spawned by:

Fiber: #3 (started at: 2022-09-14T08:31:19.081Z) was supposed to continue to: <empty trace>

Fiber: #3 (started at: 2022-09-14T08:31:19.081Z) Execution trace:

  packages/next-contentlayer/src/plugin.ts:21:94
  packages/@contentlayer/utils/src/effect/Stream.ts:32:83
  packages/@contentlayer/core/src/getConfig/index.ts:198:13
  packages/@contentlayer/core/src/getConfig/index.ts:187:28
  packages/@contentlayer/core/src/getConfig/index.ts:185:44
  packages/@contentlayer/core/src/getConfig/index.ts:172:28
  packages/@contentlayer/core/src/getConfig/index.ts:170:31
  packages/@contentlayer/core/src/getConfig/index.ts:157:28
  packages/@contentlayer/core/src/getConfig/index.ts:155:15
  packages/@contentlayer/core/src/getConfig/index.ts:152:15
  packages/@contentlayer/core/src/getConfig/index.ts:151:15
  packages/@contentlayer/core/src/cwd.ts:23:43
  packages/@contentlayer/core/src/getConfig/index.ts:136:27
  packages/@contentlayer/core/src/getConfig/index.ts:123: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-09-14T08:31:19.081Z) was spawned by:

Fiber: #0 (started at: 2022-09-14T08:31:19.061Z) was supposed to continue to: <empty trace>

Fiber: #0 (started at: 2022-09-14T08:31:19.061Z) Execution trace:

  packages/@contentlayer/utils/src/tracing-effect/index.ts:49:45
  packages/@contentlayer/core/src/cwd.ts:21: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:20:32
  packages/@contentlayer/core/src/runMain.ts:15:12

Fiber: #0 (started at: 2022-09-14T08:31:19.061Z) was spawned by: <empty trace>

OS: darwin 21.6.0 (arch: x64)
Process: /usr/local/Cellar/node@16/16.17.0_1/bin/node /Users/marco/code/priv/nextjs-blog/node_modules/.bin/next dev
Node version: v16.17.0
Contentlayer version: 0.2.8

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Activity

  1. schickling commented on Oct 4, 2022

    @schickling
    Collaborator

    Thanks for opening this issue. Can you please provide a reproduction repo with instructions how to reproduce the problem you're experiencing? Thank you!

  2. marcofranssen commented on Oct 13, 2022

    @marcofranssen
    Author

    Its a private repo, any suggestions how I can debug it myself? Maybe it is in one of the markdown files that are trying to be processed.

  3. schickling commented on Nov 7, 2022

    @schickling
    Collaborator

    I'd kindly ask you to try to reproduce the problem in a minimal way (ideally in a new repo) that you can share with me. Otherwise it won't be feasible for me to further investigate this given my limited time capacity.

  4. added this to the 0.2.10 milestone on Nov 9, 2022
  5. schickling commented on Nov 9, 2022

    @schickling
    Collaborator

    This will be fixed in the upcoming release. You can already use the dev release via 0.2.10-dev.2 in the meanwhile.

  6. added
    bug
    and removed on Nov 9, 2022
  7. marcofranssen commented on Nov 11, 2022

    @marcofranssen
    Author

    Just gave that version a test. This makes it work again with my stuff. Thanks. 🎉

  8. schickling commented on Jan 18, 2023

    @schickling
    Collaborator

    This should be addressed with the 0.3.0 release. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions