sawhney17 / logseq-citation-manager

73 stars 12 forks source link

[Bug] Uncaught (in promise) TypeError: Cannot read properties of null (reading 'forEach') #32

Closed chrskjoe closed 1 year ago

chrskjoe commented 1 year ago

When I try to use the command to insert the citation, only "inserting..." is shown on the block and the console give the error:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'forEach')
    at fS (/Users/chrix/.logseq/plugins/logseq-citation-manager/dist/assets/index.fdbc58e0.js:120)
    at async np (/Users/chrix/.logseq/plugins/logseq-citation-manager/dist/assets/index.fdbc58e0.js:120)

I am using MacOS, and the logseq version is 0.8.0

image
sawhney17 commented 1 year ago

Set a template in plugin settings. On 12 Aug 2022 at 6:34 PM +0400, liberix @.***>, wrote:

When I try to use the command to insert the citation, only "inserting..." is shown on the block and the console give the error: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'forEach') at fS (/Users/chrix/.logseq/plugins/logseq-citation-manager/dist/assets/index.fdbc58e0.js:120) at async np (/Users/chrix/.logseq/plugins/logseq-citation-manager/dist/assets/index.fdbc58e0.js:120) I am using MacOS, and the logseq version is 0.8.0 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

chrskjoe commented 1 year ago

Hi, thanks for reply. Inserting page works now, but inserting a block still shows nothing.

The template for block is

- {title} by {author}
template:: citation-block
image
sawhney17 commented 1 year ago

Have you written citation-block in the settings? Perhaps try a name without a dash. On 13 Aug 2022 at 9:41 AM +0400, liberix @.***>, wrote:

Hi, thanks for reply. Inserting page works now, but inserting a block still shows nothing. The template for block is

  • {title} by {author} template:: citation-block — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
chrskjoe commented 1 year ago

I put the "citation-block" in the settings and a name without dash cannot work either. Actually, the page template with a dash works fine.

image
sawhney17 commented 1 year ago

Can you send a screenshot of the template? And possibly the settings screen as well. On 13 Aug 2022 at 12:29 PM +0400, liberix @.***>, wrote:

I put the "citation-block" in the settings and a name without dash cannot work either. Actually, the page template with a dash works fine. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

chrskjoe commented 1 year ago

Here is the template:

image

And here is the settings:

image

Thanks

sawhney17 commented 1 year ago

You have to indent your actual template underneath the template:: citatinBlock block On 13 Aug 2022 at 3:27 PM +0400, liberix @.***>, wrote:

Here is the template: And here is the settings: Thanks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

chrskjoe commented 1 year ago

It works now. Thanks