debanjandhar12 / logseq-chatgpt-plugin

A tightly integrated ChatGPT plugin for Logseq.
GNU Affero General Public License v3.0
108 stars 10 forks source link

Cannot read properties of undefined (reading 'toLowerCase') #22

Closed taariy closed 1 year ago

taariy commented 1 year ago

I am receiving the following error message: "Cannot read properties of undefined (reading 'toLowerCase')". This error message is causing the plugin to become unusable.

The error first appears as "The Ask ChatGPT button failed to mount. You can still use the Ask ChatGPT command/shortcut to interact with the page." After this, when I try to use the keyboard shortcut, I receive the error "Cannot read...", and the plugin stops working.

RMTZen commented 1 year ago

I have also been having this issue since I believe the release of 1.3.0, can we get an update on this please as it has stopped the plugin from being usable in it's present state

debanjandhar12 commented 1 year ago

Can one of you share your OS version and logseq version please?

RMTZen commented 1 year ago

image

image

But I've just seen there is an update for LogSeq which I have now ran, didn't realise I had fallen so far behind and it had got to 0.9.6 already, now the plugin is working again, was this was user error for me and I am sorry to have bothered you.

@taariy, might be worth you double checking if your LogSeq needs updating as well.

taariy commented 1 year ago

image image image

Unable to use plugin with mentioned error messages

cnrpman commented 1 year ago

It happens at this line

image
cnrpman commented 1 year ago

@taariy @RMTZen A solution is adding :preferred-workflow :now to your config.edn of the graph with this issue in Logseq.

It happens when a graph is setup from a very old version of Logseq (yes, it's a graph specific issue) From the plugin side, a solution is adding a hasProperty check From Logseq side, it requires a better default key overriding for configs feed to plugins API 👀

debanjandhar12 commented 1 year ago

@taariy @RMTZen A solution is adding :preferred-workflow :now to your config.edn of the graph with this issue in Logseq.

It happens when a graph is setup from a very old version of Logseq (yes, it's a graph specific issue) From the plugin side, a solution is adding a hasProperty check From Logseq side, it requires a better default key overriding for configs feed to plugins API 👀

Thank you for the help. I have added an check for it in plugin too.