srg-kostyrko / obsidian-journal

MIT License
106 stars 7 forks source link

Issue with Journals Plugin: TypeError: this.item.key.intersect is not a function #57

Closed sergioatp closed 3 months ago

sergioatp commented 3 months ago

Issue with Journals Plugin: TypeError: this.item.key.intersect is not a function

Description

I am experiencing a critical issue with the Journals plugin in Obsidian. The plugin is throwing a TypeError: this.item.key.intersect is not a function in the developer console, which prevents the creation of new journal entries via the calendar. This issue occurs even after disabling almost all other plugins except for DataView, Journals, and Templater. Below is a detailed breakdown of the setup and error logs.

Setup Details

Folder Structure

# 2024-06-30 07_24_29-New tab - AIFusionVision - Obsidian v1 6 5 2024-07-04 08_44_58-Template-01-Daily - AIFusionVision - Obsidian v1 6 5

Steps to Reproduce

  1. Open Obsidian and enable the DataView, Journals, and Templater plugins.
  2. Ensure that the journal folder structure is set as described above.
  3. Attempt to create a new journal entry via the calendar.

Expected Behavior

A new journal entry should be created successfully without any errors.

Actual Behavior

The plugin fails to create a new journal entry, and the following error is displayed in the developer console:

Uncaught (in promise) TypeError: this.item.key.intersect is not a function
    at Node.intersect (plugin:journals:2174:30)
    at IntervalTree.tree_search_interval (plugin:journals:2653:22)
    at IntervalTree.search (plugin:journals:2341:14)
    at IntervalTree.find (plugin:journals:2344:14)
    at CalendarViewMonth.updateNotesIndex (plugin:journals:6282:41)
    at CalendarViewMonth.eval (plugin:journals:6140:18)
    at Generator.next (<anonymous>)
    at eval (plugin:journals:28:71)
    at Promise (<anonymous>)
    at asyncGeneratorStep (plugin:journals:24:12)
    at _await (plugin:journals:24:12)

Request for Assistance

Please investigate this issue and provide a fix or workaround. The current plugin behavior severely impacts my ability to use the Journals plugin effectively.

Thank you for your assistance.


Attachments:

srg-kostyrko commented 3 months ago

I found the problem - your screenshots helped a lot. This happens because in your template you have journal related properties in frontmatter with variable instead of date like

---
journal: Journal
journal-start-date: {{date}}
journal-end-date: {{date}}
journal-section: day
---

Just remove them in template - plugin will insert them when new note created. If it does not help right away - close and open Obsidian (to reset plugin state).

I'll add more check to prevent such failures in next release

sergioatp commented 3 months ago

Thank you. The useful tips provided resolved this issue. Your assistance has been invaluable. It's working great now.