obsidian-zotlit icon indicating copy to clipboard operation
obsidian-zotlit copied to clipboard

Error: Unexpected annotation data: annotationKey must be defined

Open lossfunc opened this issue 1 year ago • 3 comments

zotero 导出 obsidian 后,有时候在 obsidian 那边删了,重新在 zotero 那边新建Note,就会失败,console 信息:plugin:zotlit:333 Uncaught (in promise) Error: Unexpected annotation data: annotationKey must be defined

lossfunc avatar Oct 24 '23 02:10 lossfunc

Same problem here.

DennisFriedl avatar Feb 12 '24 09:02 DennisFriedl

I'm getting this error with many of my Zotero items now. Here are the logs in the console:

[2024-02-12T11:56:55.917] [ERROR] obsidian-zotero:main - Unexpected annotation data {
  attachmentURI: 'http://zotero.org/users/3906100/items/RM9ABLY8',
  pageLabel: '91',
  position: { pageIndex: 14, rects: [ [Array] ] },
  citationItem: {
    uris: [ 'http://zotero.org/users/3906100/items/I5G83YI6' ],
    locator: '91'
  }
} nh(1) [
  co {
    code: 'missing',
    path: We(1) [ 'annotationKey' ],
    data: undefined,
    source: undefined,
    writers: {
      mustBe: [Function: mustBe],
      writeReason: [Function: writeReason],
      addContext: [Function: cI]
    },
    parts: undefined
  },
  byPath: {
    annotationKey: co {
      code: 'missing',
      path: [We],
      data: undefined,
      source: undefined,
      writers: [Object],
      parts: undefined
    }
  },
  count: 1
]

and

plugin:zotlit:363 Uncaught (in promise) Error: Unexpected annotation data: annotationKey must be defined
    at yM (plugin:zotlit:363:388)
    at Object.replacement (plugin:zotlit:359:39872)
    at k.D (turndown.js:2:9551)
    at turndown.js:2:9210
    at NodeList.reduce (<anonymous>)
    at k.b (turndown.js:2:9059)
    at k.D (turndown.js:2:9459)
    at turndown.js:2:9210
    at NodeList.reduce (<anonymous>)
    at k.b (turndown.js:2:9059)

DennisFriedl avatar Feb 12 '24 11:02 DennisFriedl

I know when the error occurs now:

  1. Create a note as attachment to a Zotero item
  2. Quote parts of the document in this note which are linked to the pages of the document
  3. Try to create a literature note for that item -> Error

Workaround: Go to the quotes in the note -> rightclick -> Unlink. When you unlinked all quotes you can create a literature note.

DennisFriedl avatar Apr 11 '24 11:04 DennisFriedl