brianpetro / obsidian-smart-connections

Chat with your notes & see links to related content with AI embeddings. Use local models or 100+ via APIs like Claude, Gemini, ChatGPT & Llama 3

Home Page:https://smartconnections.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read properties of null (reading 'path') error

AMGMNPLK opened this issue · comments

I encountered an error while using the Smart Connections plugin for Obsidian. When I tried to ask the LLM a question, I received the following alert:

[Smart Connections]

Cannot read properties of null (reading 'path') 

In the console, I also noticed these related error messages:

plugin:smart-connections:8282 TypeError: Cannot read properties of null (reading 'path')
    at eval (plugin:smart-connections:8310:71)
    at Array.map (<anonymous>)
    at ScChat.parse_user_message (plugin:smart-connections:8310:55)
    at ScChat.new_user_message (plugin:smart-connections:8045:30)
    at ScChat.new_user_message (plugin:smart-connections:8279:23)
    at HTMLButtonElement.eval (plugin:smart-connections:6664:34)

plugin:smart-connections:6766 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'querySelector')
    at get last_msg [as last_msg] (plugin:smart-connections:6766:86)
    at ScChatsUI.undo_last_message (plugin:smart-connections:6825:14)
    at ScChat.new_user_message (plugin:smart-connections:8283:28)

It seems the plugin is trying to read a path property that is null, causing the error. This prevents the LLM from generating a response.

Steps to Reproduce

  1. Installed the latest version of the Smart Connections plugin in Obsidian
  2. Tried to ask the LLM a question using the Smart Connections chat interface
  3. Received the "Cannot read properties of null (reading 'path')" error

Additional Context

I also noticed some other errors in the console related to connecting to the Smart Connect server:

plugin:smart-connections:3254 Smart Connect is not running, will try to connect again later
plugin:smart-connections:3281 Failed to reconnect after 10 attempts 
plugin:smart-connections:3400 Failed to reconnect, will not retry...
plugin:smart-connections:2507 Checking for local Smart Connect server...
plugin:smart-connections:2517 Could not connect to local Smart Connect server

Not sure if this is related to the main error, but thought it was worth mentioning. Let me know if you need any other details to investigate this issue. Thanks!

Hi @AMGMNPLK

Thanks for bringing this to my attention 😊

If you could, please toggle on this setting:
Screenshot 2024-06-06 at 8 12 43 AM

It will make the logs you share more useful by providing improved files and line number references.

If this is still a problem, please re-open this issue with the following details:

  1. Updated screenshots after turning on the "debug at startup time" setting.
  2. which chat model you are using (a screenshot of you smart chat settings would also be helpful)

🌴