Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create note #25

Closed
CarloLoTelit opened this issue Apr 20, 2021 · 28 comments
Closed

Unable to create note #25

CarloLoTelit opened this issue Apr 20, 2021 · 28 comments

Comments

@CarloLoTelit
Copy link

In version 1.6.2 on Windows 10 if a daily note already exists, the plugin is unable to add a new review item

@patrickcjwall
Copy link

patrickcjwall commented May 10, 2021

Yes I am also having this issue (also v 1.6.2 on Windows 10). Any idea of a fix/workaround? For the moment I am setting to review on a date that doesn't yet have a note and then copying to the note I really want but this is not a permanent solution

@ryanjamurphy
Copy link
Owner

Hm. Sorry for the trouble. I'm struggling to reproduce this issue, however. Can someone pull up the console (cmd/ctrl+alt/opt+i, then click the Console tab at the top) and reproduce the issue to see if any errors are reported?

Thanks!

@patrickcjwall
Copy link

Thanks @ryanjamurphy -- I'm quite new to Obsidian and that key combination isn't doing anything...is there another way to get to the console?

@ryanjamurphy
Copy link
Owner

What operating system are you using, @pwal2425? Note that if it's macOS, the key command should be cmd+opt+i. If Windows, it's ctrl+alt+i.

@patrickcjwall
Copy link

Windows 10 and Obsidian v.0.12.3. cmd+opt+i isn't doing anything...

@ryanjamurphy
Copy link
Owner

Windows 10 and Obsidian v.0.12.3. cmd+opt+i isn't doing anything...

D'oh, sorry, I had it wrong! It looks like it's ctrl+shift+i on Windows.

@patrickcjwall
Copy link

Ah great. This is what the console said when i set '- [ ] Test line' for review today (which already has a daily note called '2021.05.12 Wednesday «Plan»'

Checking for block:
main.ts:97 Checking if line '- [ ] Test line' is a block.
main.ts:101 Checking block ^kvmd2zv
main.ts:97 Checking if line '- [ ] Test line' is a block.
main.ts:101 Checking block ^kvmd2zv
main.js:246 Failed to create file: '009 Timestamped/2021.05.12 Wednesday «Plan».md' Error: File already exists.
at t. (app.js:1)
at app.js:1
at Object.next (app.js:1)
at s (app.js:1)
createDailyNote @ main.js:246
async function (async)
createDailyNote @ main.js:218
eval @ main.ts:188
step @ tslib.es6.js:102
eval @ tslib.es6.js:83
eval @ tslib.es6.js:76
__awaiter @ tslib.es6.js:72
Review.setReviewDate @ main.ts:114
eval @ main.ts:273
(anonymous) @ app.js:1
app.js:1 Uncaught (in promise) TypeError: Cannot read property 'path' of undefined
at t. (app.js:1)
at app.js:1
at Object.next (app.js:1)
at app.js:1
at new Promise ()
at o (app.js:1)
at t.read (app.js:1)
at Review.eval (eval at (app.js:1), :733:64)
at step (eval at (app.js:1), :72:23)
at Object.eval [as next] (eval at (app.js:1), :53:53)

@patrickcjwall
Copy link

And this is when I set 'Test line 2' for review on a date that does not yet have a note:

Checking for block:
main.ts:97 Checking if line '- [ ] Test line 2' is a block.
main.ts:101 Checking block ^kvmd2zv
main.ts:97 Checking if line '- [ ] Test line 2' is a block.
main.ts:101 Checking block ^kvmd2zv
main.ts:121

@ryanjamurphy
Copy link
Owner

Thanks. It's not clear why this is happening. Still, I just tried a couple of things—update to 1.6.3 and let me know if you see the issue again.

@samthom
Copy link

samthom commented May 14, 2021

Using Version 1.6.3 With Obsidian v0.12.3 (In Linux)
The same issue persist. Don't know about macOS and Windows.

@ryanjamurphy
Copy link
Owner

A question for everyone here: What is the format for your daily note filename?

@pwal2425, I've located your error: you cannot use periods (.) in filenames. That's causing issues with finding the right path for an existing file. I don't think I can fix this, because I'm not doing anything special when writing to these files—just using Obsidian API calls. I recommend changing your format to use e.g., dashes (-) or something else. Sorry for the trouble.

@patrickcjwall
Copy link

patrickcjwall commented May 14, 2021 via email

@ryanjamurphy
Copy link
Owner

The timing's hard to pin down, as there's a number of things that could have changed. Ultimately, though, I'm not sure why it ever would have worked. I think this function is handled by the Daily Notes Interface created by @liamcain—Liam, do you have any quick guesses as to why users can no longer use . in the filenames?

@liamcain
Copy link
Contributor

@ryanjamurphy, hmmm looks like that could be an issue on my end. I can take a look.

@samthom
Copy link

samthom commented May 15, 2021

@ryanjamurphy I'm using DD-MM-YY format for my daily notes. The first time when I add a note for review it works. New note get created with review section below my template. But if I tried to add another note to same day it shows unable to create new file
Basically I am not able add notes for review if the daily note file exist for that day.

Do you want me to open a new issue, Since mine seems to be a different issue ?

@ryanjamurphy
Copy link
Owner

Hmm. @samthom what's your console saying when it fails? What is the folder path for your files?

@samthom
Copy link

samthom commented May 16, 2021

image

My daily notes path is /home/samthomas/Cloud/System Sync/Notes/Second Brain/Resources/Zettlekasten/Daily .
If you're concerned about the privileges, The first time when I add note for review it's working.

@patrickcjwall
Copy link

@ryanjamurphy I am currently using the Daily Note core plugin, as opposed to the one through the periodic notes plugin (though I do use the periodic notes plugin to create weekly notes). So far this approach has not caused problems, but perhaps it is part of the issue here?

@ryanjamurphy
Copy link
Owner

@pwal2425 You could try disabling the Daily Note core plugin and using only Periodic Notes (the functionality is equivalent). I don't think it's your issue, but it's worth a shot.


@samthom The plugin (1) checks for a file that matches the filename of the daily note. (2) If it finds no such file, it creates one. (3) If it does find a file, it appends to it.

So the problem's likely in (1). Something about your set up is causing the plugin to fail to find the existing note. Is this problem new for you? Did it work previously? If so, when did it change/any guesses as to what might have changed?

@samthom
Copy link

samthom commented May 19, 2021

No I recently started using this setup with review plugin and periodic notes. I disabled daily notes core plugin after the setup.
image
This is my periodic notes setting for daily notes.

@ryanjamurphy
Copy link
Owner

@samthom

  1. Does the Daily Note Template file end in .md? It might just be cut off in the screenshot.
  2. Is there a chance you could have multiple files named e.g., 19-05-21? I doubt it, but it would mean you don't have uniquely-named files...

@samthom
Copy link

samthom commented May 20, 2021

@ryanjamurphy

This is my template file
Templates/Periodic Notes/Daily Note.md
And I tried without the template, Problem persists without template also.

No there's only single file 19-05-21 as you can see below.
image

@CarloLoTelit
Copy link
Author

I have the same error log reported here and according to this note I looked at how the target file name is picked -> enabling debug logs it seems that the plugin looks for a file with dd.mm.yyyy format, which is different than the format I use for my notes (which is yyyy-mm-dd), that's why the plugin fails at finding the file at first.

immagine

The problem however is in my Natural language Dates plugin's configuration, where the "Date format" entry was set to "dd.mm.yyyy" instead than "yyyy-mm-dd", so it was impossible for Review plugin to find the proper file name.

If this is confirmed by the others, I believe we can close the issue since it's not due to Review plugin.

@samthom
Copy link

samthom commented May 20, 2021

@ryanjamurphy @CarloLoTelit
Thanks, I changed Natural language dates date format. now it works fine.

@ryanjamurphy
Copy link
Owner

Amazing! Thanks for your detective work, @CarloLoTelit, and thanks all for your diligence here.

@pwal2425 Have you had any luck? I would love to close this issue.

@patrickcjwall
Copy link

Yes! Resolved. I had actually checked this as one of the very first possible issues and to the naked eye there seemed not to be a difference, but I copy-pasted for good measure and now it seems to work. Perhaps there was a trailing space or something that I hadn't noticed.

@patrickcjwall
Copy link

Related to this though, would it be possible to modify the input coming from natural language dates for review? The situation for me is this:

  • I keep all my timestamped files in a separate folder. This includes daily and weekly notes, meeting notes etc.
  • To distinguish the daily notes (I call them plans as I used them mostly for planning) from other files with the same date, I use the format 'YYYY.MM.DD dddd plan'
  • In order to use review, however, this means that I need to include the 'plan' as part of the date format for natural language dates. So if I want to use that plugin in another context (to insert a date directly into a file, for eg) I have to insert it and go back and delete the 'plan'
  • It would be super neat if I could have the date format for natural language dates as YYYY.MM.DD dddd and then have the review plugin know to add the 'plan' part to look for the right daily note.

But maybe too tricky to do? Please let me know if you would prefer me to open another thread for this.

@ryanjamurphy
Copy link
Owner

Closing this thread! @liamcain just to summarize, it's not an issue with the interface. Sorry for the distraction!

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants