contentlayerdev / contentlayer

Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app
https://www.contentlayer.dev
MIT License
3.29k stars 203 forks source link

TypeError: Cannot read properties of undefined (reading 'cacheItemsMap') #647

Closed trebeljahr closed 4 months ago

trebeljahr commented 7 months ago

Stack Trace:

TypeError: Cannot read properties of undefined (reading 'cacheItemsMap')
    at IEffectTotal.effect (file:///Users/rico/projects/trebeljahr.com/node_modules/@contentlayer/source-files/src/fetchData/index.ts:187:19)
    at FiberContext.evaluateNow (file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Fiber/context.ts:940:54)
    at file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Fiber/context.ts:576:33
    at file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Support/Scheduler/index.ts:15:9
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) was supposed to continue to: <empty trace>

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) Execution trace: <empty trace>

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) was spawned by:

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) was supposed to continue to: <empty trace>

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) Execution trace: <empty trace>

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) was spawned by:

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) was supposed to continue to: <empty trace>

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) Execution trace: <empty trace>

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) was spawned by:

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) was supposed to continue to: <empty trace>

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) Execution trace: <empty trace>

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) was spawned by:

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) was supposed to continue to: <empty trace>

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) Execution trace: <empty trace>

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) was spawned by:

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) was supposed to continue to: <empty trace>

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) Execution trace: <empty trace>

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) was spawned by:

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) was supposed to continue to: <empty trace>

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) Execution trace: <empty trace>

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) was spawned by:

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) was supposed to continue to: <empty trace>

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) Execution trace: <empty trace>

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) was spawned by:

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) was supposed to continue to: <empty trace>

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) Execution trace: <empty trace>

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) was spawned by: <empty trace>

OS: darwin 23.3.0 (arch: arm64)
Process: /Users/rico/.nvm/versions/node/v20.11.0/bin/node /Users/rico/projects/trebeljahr.com/node_modules/next/dist/server/lib/start-server.js
Node version: v20.11.0
Contentlayer version: 0.3.4
trebeljahr commented 7 months ago

I'm not sure if this is at all related but for me or even if it might be fixed in a newer version or something but some of the generated .mjs files seem to be wrong too, where contentlayer seems to be having problems with ' characters in the file names, creating invalid .js code that looks like this for some imports.

import notes__diaryEntries__06_01_2023FridayAiMeaninglessnessHoldingBackPivotingPlansAndSchindlerSListMd from './Notes__Diary Entries__06.01.2023 – Friday - AI Meaninglessness, Holding Back, Pivoting Plans, and Schindler's List.md.json' assert { type: 'json' }

sorry for the messy long file names I am just trying to import notes from my Obsidian diary right now to see if I can play around with them in next.js and publish some of them ^^

also if this is another issue/separate from the stack trace above, I can open another one ^^

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.