decaf-dev / obsidian-vault-explorer

Explore your Obsidian vault in visual format
https://vaultexplorer.com
MIT License
37 stars 1 forks source link

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'contains') #69

Closed Moyf closed 2 weeks ago

Moyf commented 3 weeks ago

I set a filter like this: image

And got an Error: image

Here are more details: image

image

decaf-dev commented 3 weeks ago

Showing the code like this is very helpful! Thank you. Did you fork the project to be able to do that?

Moyf commented 3 weeks ago

Showing the code like this is very helpful! Thank you. Did you fork the project to be able to do that?

Oh, actually it's not. 🤣 I was planning to create a new branch to support the new date format and submit a PR... but this change is too simple (just one line) and I found that just adding a format string won't solve other issues in the templater text. So I gave up, hahaha.


Actually the error information and related codes doesn't rely on the source code, just open the Dev Tool and click on the highlighted text with line number: image

Then it would jump to the place where error haappens (in the main.js)

Then I can set break points or modify the codes to see what happens : )

decaf-dev commented 3 weeks ago

I think the issue is that String.contains was being used instead of String.includes. contains doesn't exist in JavaScript. Obsidian adds it as to the global prototype function of the String, so theoretically it should be available. I don't get a crash in my version of Obsidian, but maybe there's some differences in the wild.

Please try 1.7.2 and let me know if that fixes it.

decaf-dev commented 3 weeks ago

Could you send me your Obsidian debug info for the version that you experienced this bug on?

To find the debug open, open the command palette and then search Show debug info and then click Copy to clipboard

Moyf commented 3 weeks ago

Could you send me your Obsidian debug info for the version that you experienced this bug on?

To find the debug open, open the command palette and then search Show debug info and then click Copy to clipboard

SYSTEM INFO:
    Obsidian version: v1.6.3
    Installer version: v1.5.12
    Operating system: Windows 10 Pro 10.0.22631
    Login status: logged in
    Catalyst license: insider
    Insider build toggle: on
    Live preview: on
    Base theme: dark
    Community theme: Pure v0.1.5
    Snippets enabled: 44
    Restricted mode: off
    Plugins installed: 445
    Plugins enabled: 76
        1: Update Time Updater v0.1.4
        2: Periodic Notes v0.0.17
        3: Shell commands v0.22.0
        4: Recent Files v1.4.1
        5: Calendar v1.5.10
        6: Commander v0.5.1
        7: Slash Commander v0.2.16
        8: Advanced URI v1.40.1
        9: Customizable Menu v2.2.0
        10: Hide Sidebars on Window Resize v1.1.0
        11: Rapid Notes v1.2.5
        12: Templater v2.3.3
        13: Buttons v0.5.1
        14: Consistent Attachments and Links v1.3.0
        15: Quick Switcher++ v4.2.2
        16: Another Quick Switcher v11.4.1
        17: Latex Suite v1.9.3
        18: Home tab v1.2.1
        19: Note Toolbar v1.7.28
        20: Attachment Pro v0.1.0
        21: QuickAdd v1.9.0
        22: Reveal Active File Button v2.0.3
        23: Easy Typing v5.4.0
        24: Text Transporter v1.0.11
        25: Open vault in VSCode v1.2.2
        26: Hotkeys for templates v1.4.3
        27: Quiet Outline v0.3.31
        28: Dataview v0.5.66
        29: Settings Management v1.0.5
        30: Admonition v10.3.2
        31: AttachFlow v0.3.1
        32: BRAT v1.0.1
        33: Collapse All v2.1.0
        34: Dynamic Highlights v0.3.1
        35: Floating Search v3.5.1
        36: Focus Mode v1.11.4
        37: Hover Editor v0.11.20
        38: Lineage v0.5.4
        39: List Callouts v1.2.7
        40: Local GPT v1.7.0
        41: MySnippets v1.2.3
        42: Nuke Orphans v1.2.5
        43: Outliner.md v0.1.5
        44: Pomodoro Timer v1.2.3
        45: Style Settings v1.0.8
        46: Weread v0.10.0
        47: WuCai highlights Official v24.4.16
        48: Tab Navigator v0.5.1
        49: View Count v2.2.1
        50: Image Captions v1.1.0
        51: Image Toolkit v1.4.1
        52: Iconize v2.12.1
        53: Omnisearch v1.23.0
        54: Code Styler v1.1.7
        55: Better Word Count v0.10.1
        56: Workspaces Plus v0.3.3
        57: Tabs v1.0.4
        58: Tasks v7.4.0
        59: Clever Search v0.2.10
        60: Components v1.2.0
        61: Contribution Graph v0.9.0
        62: Obsidian Columns v1.5.2
        63: Set View Mode per Note v1.0.3
        64: POWER MODE v1.0.5
        65: The Queue v1.1.1
        66: File Explorer++ v1.2.1
        67: Note Definitions v0.9.1
        68: Dice Roller v11.0.4
        69: Vault Explorer v1.7.1
        70: Local Images Plus v0.15.9
        71: Vim IM Select v0.2.0
        72: Repeat Last Command(s) v2.10.0
        73: Easy toggle sidebars v2.0.0
        74: Folder notes v1.7.22
        75: Vertical Tabs View v2.6.0
        76: Front Matter Title v3.9.0

RECOMMENDATIONS:
    Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
decaf-dev commented 3 weeks ago

Great. Thanks for that. It's possible it's just a Windows bug.

Did 1.7.2 fix it?

On Tue, Jun 11, 2024, 9:56 PM Moy @.***> wrote:

Could you send me your Obsidian debug info for the version that you experienced this bug on?

To find the debug open, open the command palette and then search Show debug info and then click Copy to clipboard

SYSTEM INFO: Obsidian version: v1.6.3 Installer version: v1.5.12 Operating system: Windows 10 Pro 10.0.22631 Login status: logged in Catalyst license: insider Insider build toggle: on Live preview: on Base theme: dark Community theme: Pure v0.1.5 Snippets enabled: 44 Restricted mode: off Plugins installed: 445 Plugins enabled: 76 1: Update Time Updater v0.1.4 2: Periodic Notes v0.0.17 3: Shell commands v0.22.0 4: Recent Files v1.4.1 5: Calendar v1.5.10 6: Commander v0.5.1 7: Slash Commander v0.2.16 8: Advanced URI v1.40.1 9: Customizable Menu v2.2.0 10: Hide Sidebars on Window Resize v1.1.0 11: Rapid Notes v1.2.5 12: Templater v2.3.3 13: Buttons v0.5.1 14: Consistent Attachments and Links v1.3.0 15: Quick Switcher++ v4.2.2 16: Another Quick Switcher v11.4.1 17: Latex Suite v1.9.3 18: Home tab v1.2.1 19: Note Toolbar v1.7.28 20: Attachment Pro v0.1.0 21: QuickAdd v1.9.0 22: Reveal Active File Button v2.0.3 23: Easy Typing v5.4.0 24: Text Transporter v1.0.11 25: Open vault in VSCode v1.2.2 26: Hotkeys for templates v1.4.3 27: Quiet Outline v0.3.31 28: Dataview v0.5.66 29: Settings Management v1.0.5 30: Admonition v10.3.2 31: AttachFlow v0.3.1 32: BRAT v1.0.1 33: Collapse All v2.1.0 34: Dynamic Highlights v0.3.1 35: Floating Search v3.5.1 36: Focus Mode v1.11.4 37: Hover Editor v0.11.20 38: Lineage v0.5.4 39: List Callouts v1.2.7 40: Local GPT v1.7.0 41: MySnippets v1.2.3 42: Nuke Orphans v1.2.5 43: Outliner.md v0.1.5 44: Pomodoro Timer v1.2.3 45: Style Settings v1.0.8 46: Weread v0.10.0 47: WuCai highlights Official v24.4.16 48: Tab Navigator v0.5.1 49: View Count v2.2.1 50: Image Captions v1.1.0 51: Image Toolkit v1.4.1 52: Iconize v2.12.1 53: Omnisearch v1.23.0 54: Code Styler v1.1.7 55: Better Word Count v0.10.1 56: Workspaces Plus v0.3.3 57: Tabs v1.0.4 58: Tasks v7.4.0 59: Clever Search v0.2.10 60: Components v1.2.0 61: Contribution Graph v0.9.0 62: Obsidian Columns v1.5.2 63: Set View Mode per Note v1.0.3 64: POWER MODE v1.0.5 65: The Queue v1.1.1 66: File Explorer++ v1.2.1 67: Note Definitions v0.9.1 68: Dice Roller v11.0.4 69: Vault Explorer v1.7.1 70: Local Images Plus v0.15.9 71: Vim IM Select v0.2.0 72: Repeat Last Command(s) v2.10.0 73: Easy toggle sidebars v2.0.0 74: Folder notes v1.7.22 75: Vertical Tabs View v2.6.0 76: Front Matter Title v3.9.0

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

— Reply to this email directly, view it on GitHub https://github.com/decaf-dev/obsidian-vault-explorer/issues/69#issuecomment-2162056378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTQYW3QEF7ORTW7EAYMYWLZG7BIHAVCNFSM6AAAAABJEBCRTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGA2TMMZXHA . You are receiving this because you commented.Message ID: @.***>

Moyf commented 3 weeks ago

Great. Thanks for that. It's possible it's just a Windows bug. Did 1.7.2 fix it?

image

Emmmm strange! After updating to 1.7.2, the Error just became includes lol. I think maybe the main problem is the null?

image maybe value got no value actrually.. I will try to do some debug!

Moyf commented 3 weeks ago

image

OHHHHHHHHH I see!! It might be that for some of my Notes, they just have no tags.. Then the value became null.

And just check if this value is null then all is well! image

Moyf commented 3 weeks ago

We wrongly accused the contains function. 😂

Just did a quick-fix PR ! I searched for some() and every() but not sure did I miss anywhere else.


( And I think those kind of Non-standard notes would became unexpected situation that needs to be carefully considered, haha. )

decaf-dev commented 3 weeks ago

Okay. I did an overhaul of the property loading. Please try 1.7.3. Let know me if it is fixed.

Moyf commented 3 weeks ago

Okay. I did an overhaul of the property loading. Please try 1.7.3. Let know me if it is fixed.

Yap! 1.7.3 has fixed it 👍🏻