Rainbell129 / Obsidian-Homepage

A dashboard for your obsidian vault.
MIT License
1.41k stars 124 forks source link

Error in component "<Show></Show> ": ReferenceError: Show is not defined #3

Closed kenjibailly closed 2 years ago

kenjibailly commented 2 years ago

image image

I have a note with in the frontmatter

birthday: 1995-07-28

Not sure why I'm getting this error or how to fix it.

Rainbell129 commented 2 years ago

Have you set up react components directory correctly? Take a screenshot, I’ll have a look.

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Mind Glowing @.> 发送时间: Friday, February 25, 2022 9:02:30 AM 收件人: Rainbell129/Obsidian-Homepage @.> 抄送: Subscribed @.***> 主题: [Rainbell129/Obsidian-Homepage] Error in component " ": ReferenceError: Show is not defined (Issue #3)

[image]https://user-images.githubusercontent.com/9883910/155630649-176929d7-82d5-4acf-a66c-6faa79e8982f.png [image]https://user-images.githubusercontent.com/9883910/155630678-2b161077-63ac-4b79-badd-f96e70cdb078.png

I have a note with in the frontmatter birthday: 1995-07-28

Not sure why I'm getting this error or how to fix it.

― Reply to this email directly, view it on GitHubhttps://github.com/Rainbell129/Obsidian-Homepage/issues/3, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN6HKYBJB442XRJ2FUW3HI3U43IKNANCNFSM5PI5PSTA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

kenjibailly commented 2 years ago

Have you set up react components directory correctly? Take a screenshot, I’ll have a look. 获取 Outlook for iOShttps://aka.ms/o0ukef ____ 发件人: Mind Glowing @.> 发送时间: Friday, February 25, 2022 9:02:30 AM 收件人: Rainbell129/Obsidian-Homepage @.> 抄送: Subscribed @.> 主题: [Rainbell129/Obsidian-Homepage] Error in component " ": ReferenceError: Show is not defined (Issue #3) [image]https://user-images.githubusercontent.com/9883910/155630649-176929d7-82d5-4acf-a66c-6faa79e8982f.png [image]https://user-images.githubusercontent.com/9883910/155630678-2b161077-63ac-4b79-badd-f96e70cdb078.png I have a note with in the frontmatter birthday: 1995-07-28 Not sure why I'm getting this error or how to fix it. ― Reply to this email directly, view it on GitHub<#3>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN6HKYBJB442XRJ2FUW3HI3U43IKNANCNFSM5PI5PSTA. You are receiving this because you are subscribed to this thread.Message ID: @.>

image

Not sure what I need to take a screenshot of. Do I need to configure something? I change the music and birthday countdown file to "music_and_birthday_countdown" because it gave an error saying that function name was invalid. First time using react components

Rainbell129 commented 2 years ago

Delete the Obsidian Vault if that's your vault name.

kenjibailly commented 2 years ago

Delete the Obsidian Vault if that's your vault name.

My Vault name is Obsidian and I have everything in a folder Obsidian Vault/ So it looks like this: Obsidian/Obsidian Vault I kinda like it that way

Edit: image

Rainbell129 commented 2 years ago

You should have a folder solely for putting components. And you should use relative path for the directory setting. I think the problem'll be solved if you do so. I'll show you my setting:

Screen Shot 2022-02-25 at 9 38 22 AM Screen Shot 2022-02-25 at 9 39 41 AM
Rainbell129 commented 2 years ago

Well then try creating a components folder dedicated only to components

Rainbell129 commented 2 years ago

The name of the script itself does not matter.

Screen Shot 2022-02-25 at 9 42 20 AM

It's the thing after jsx:component: that gets referenced each time. So you should be ok if you get all settings straight whatever file names you use.

kenjibailly commented 2 years ago

The name of the script itself does not matter. Screen Shot 2022-02-25 at 9 42 20 AM It's the thing after jsx:component: that gets referenced each time. So you should be ok if you get all settings straight whatever file names you use.

I apparently didn't have that top code in that file, pretty weird... Anyway thanks, it's working now!

How does it work though I see 3 buttons but can't read much of it

Rainbell129 commented 2 years ago

Well, I have only written code for the first page. If you want to use the two other buttons you'll have to write javascript there yourself. Otherwise you can delete the extra two buttons, or simply use this file instead and reference ShowI.

music and birthday countdown 1.md

kenjibailly commented 2 years ago

Well, I have only written code for the first page. If you want to use the two other buttons you'll have to write javascript there yourself. Otherwise you can delete the extra two buttons, or simply use this file instead and reference ShowI.

music and birthday countdown 1.md

Oh alright thanks!

I seem to have a problem with my birthdays though. I get this output: image

While I set birthday at birthday: 1995-03-01

Rainbell129 commented 2 years ago
final += `${basename}’s birthday is on ${hanBirthday}: ${N+1} days left \n`
let hanBirthday = birthdayMonth + “.” + birthdayDay;

find and update these two variables in the script. The 31 you get is actually Mar.1