https://www.dendron.so/ logo
#questions
Title
# questions
c

ccamara

03/10/2022, 8:35 AM
Hello, I am using dendron in two different machines. One works perfectly, and the other doesn't. As starters, whenever I create or open file for fist time, I am seeing an error stating "Cannot read property 'title' of undefined". If I close and reopen, it will not show up, but this might be pointing to some problem. Also, I believe it's related to the problem I reported some days ago here: https://discord.com/channels/717965437182410783/735365126227493004/947773426062467113 -> The daily journal was working greate yesterday in another machine, I synced the workspace from computer A yesterday, and Synced it today in computer B, but daily journal template is not working anymore
j

Joshi

03/10/2022, 8:43 AM
Hello @User Does Reload Workspace helps in the "Cannot read property 'title' of undefined" error? This often happens when Dendron does not recognize a note. For the template issue, does it have the same schema linked discord thread, or there's a new schema?
c

ccamara

03/10/2022, 8:45 AM
hi @User ! Thank you very much. Indeed realoading workspace seems to have solved the first issue.
The second one is still happening. This is my current schema:
Copy code
yaml

version: 1
schemas:
- id: daily
  title: daily
  desc: ""
  parent: root
  children:
    - journal
- id: journal
  title: journal
  desc: ""
  parent: root
  children:
    - year
- id: year
  title: year
  pattern: "[0-2][0-9][0-9][0-9]"
  children: 
    - month
- id: month
  title: month
  pattern: "[0-9][0-9]"
  children: 
    - day
- id: day
  title: day
  pattern: "[0-9][0-9]"
  namespace: true
j

Joshi

03/10/2022, 8:48 AM
Can you try updating parent of
journal
to be
daily
instead of
root
c

ccamara

03/10/2022, 8:48 AM
Yes, I was just seeing that now! Apparently, the schema has not been synced when running "Workspace sync"
I thought it should
regretfully, it's not working after that change
this is how it looks like now:
Copy code
yaml
version: 1
schemas:
- id: daily
  title: daily
  desc: ""
  parent: root
  children:
    - journal
- id: journal
  title: journal
  desc: ""
  parent: daily
  children:
    - year
- id: year
  title: year
  pattern: "[0-2][0-9][0-9][0-9]"
  children: 
    - month
- id: month
  title: month
  pattern: "[0-9][0-9]"
  children: 
    - day
- id: day
  title: day
  pattern: "[0-9][0-9]"
  namespace: true
  template:
    # identifier for the template (for a note based template, it would be the name of the note)
    id: templates.journal.day
    # what sort of template we are creating. currently, only 'note' is supported
    type: note
j

Joshi

03/10/2022, 8:56 AM
Hmm the schema looks fine and seems to be working for me. It adds template for a note
daily.journal.2022.03.10
Also not that it changes anything but heads up that you can apply a template with
template : templates.journal.day
instead of
Copy code
template:
    id: templates.journal.day
    type: note
can you share an example for which it is not working for you?
c

ccamara

03/10/2022, 9:04 AM
I've checked in my other computer and the schema is slightly different:
Copy code
yaml
version: 1
schemas:
- id: daily
  title: daily
  desc: ""
  parent: root
  children:
    - journal
- id: journal
  title: journal
  desc: ""
  parent: daily
  children:
    - year
- id: year
  title: year
  pattern: "[0-2][0-9][0-9][0-9]"
  children: 
    - month
- id: month
  title: month
  pattern: "[0-9][0-9]"
  children: 
    - day
- id: day
  title: day
  pattern: "[0-9][0-9]"
  # namespace: true
  template:
    # identifier for the template (for a note based template, it would be the name of the note)
    id: templates.journal.day
    # what sort of template we are creating. currently, only 'note' is supported
    type: note
(just the "`#namespace: true` commented out)
I will have to go back to computer A and see if the template is not synced.
j

Joshi

03/10/2022, 9:12 AM
Commenting out
namespace: true
will prevent applying schema further to its children. So if it is commented, schema will apply to
daily.journal.2022.03.10
but not
daily.journal.2022.03.10.joshi
.
c

ccamara

03/10/2022, 2:12 PM
Thanks for the comment. Yes, I wasn't sure that commenting that out would make any difference, but another user suggested it, and I was desperated so I tested it. Good news: the problem is that the vault where I had the schema and template was not syncing, and the templates.journal.day.md was missing in this laptop! Now it's solved. Thanks for being my rubber duck! 🦆
5 Views