logseq-chatgpt-plugin icon indicating copy to clipboard operation
logseq-chatgpt-plugin copied to clipboard

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at AskChatGPTHandler.ts:60:20

Open Chernfalin opened this issue 2 years ago • 3 comments

After using for a while, the "ask chatgpt" button disappeared with the following error message: "Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at AskChatGPTHandler.ts:60:20".

// Show button if current page is a ChatGPT page only
            const page = await logseq.Editor.getCurrentPage();
            if (!(page.originalName && (page.properties?.type == "ChatGPT" || page.properties?.type == "[[ChatGPT]]"))) {
                button.style.display = "none";
                window.parent.document.getElementById("main-content-container").removeEventListener("scroll", window.parent.scrollFixForChatGPTPlugin);
                return;
            }
            button.style.display = "block";

Chernfalin avatar Apr 13 '23 08:04 Chernfalin

Running normally in logseq 0.9.1.

Chernfalin avatar Apr 13 '23 14:04 Chernfalin

Will investigate and fix for v0.9.2 by tomorrow.

debanjandhar12 avatar Apr 13 '23 16:04 debanjandhar12

I have fixed it temporarily by moving the ask chatgpt button to toolbar instead of pagebar (in v1.1.0). I think pagebar is broken in the new logseq version.

debanjandhar12 avatar Apr 14 '23 16:04 debanjandhar12