PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
589 stars 25 forks source link

Error creating note when Zotero Note is available #257

Open misea opened 8 months ago

misea commented 8 months ago

I have several items that have highlights and notes in Zotero where if I try to do "Create Literature Notes" I get an error in the Obsidian console and Obsidian comes to the front, but does not have a note. Strangely if I delete the Zotero note attached to the item, the error no longer appears and the PDF annotations are imported. I have no idea what is causing it, and I have tried to reproduce, but haven't figured out the simple case.

Unexpected annotation data {
  attachmentURI: 'http://zotero.org/users/429318/items/S456NKV7',
  pageLabel: '110',
  position: { pageIndex: 4, rects: [ [Array], [Array], [Array], [Array] ] },
  citationItem: {
    uris: [ 'http://zotero.org/users/429318/items/HUW4RNM7' ],
    locator: '110'
  }
} 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
]
veale commented 7 months ago

I have a related error, as it seems when a standalone note is attached to an item in Zotero, you cannot cite that item — pressing return in the markdown citation window does nothing.

Katherine923-creator commented 6 months ago

ME TOOOOOO!!!!!

unlsycn commented 6 months ago

The same

Wizard-one commented 5 days ago

I have same issue too, I think is same as #237.

In note have a lot of annotation link to origin PDF, unlink every annotation seen impossible.

My environment:

This is my log

plugin:zotlit:6 [2024-07-16T15:04:54.073] [ERROR] obsidian-zotero:main - Unexpected annotation data {
  attachmentURI: 'http://zotero.org/users/10022128/items/PTG8WAI5',
  pageLabel: '112',
  position: { pageIndex: 2, rects: [ [Array] ] },
  citationItem: {
    uris: [ 'http://zotero.org/users/10022128/items/JRVLZFVA' ],
    locator: '112'
  }
} nh(1) [
  co {
    code: 'missing',
    path: We(1) [ 'annotationKey' ],
    data: undefined,
    source: undefined,
    writers: {
      mustBe: [Function: mustBe],
      writeReason: [Function: writeReason],
      addContext: [Function: lI]
    },
    parts: undefined
  },
  byPath: {
    annotationKey: co {
      code: 'missing',
      path: [We],
      data: undefined,
      source: undefined,
      writers: [Object],
      parts: undefined
    }
  },
  count: 1
]
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)
    at k.D (turndown.js:2:9459)
    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)
    at k.turndown (turndown.js:2:10070)
    at ud.turndown (plugin:zotlit:359:40322)
    at uM (plugin:zotlit:359:24823)
yM @ plugin:zotlit:363
replacement @ plugin:zotlit:359
D @ turndown.js:2
(anonymous) @ turndown.js:2
b @ turndown.js:2
D @ turndown.js:2
(anonymous) @ turndown.js:2
b @ turndown.js:2
D @ turndown.js:2
(anonymous) @ turndown.js:2
b @ turndown.js:2
D @ turndown.js:2
(anonymous) @ turndown.js:2
b @ turndown.js:2
turndown @ turndown.js:2
turndown @ plugin:zotlit:359
uM @ plugin:zotlit:359
await in uM (async)
callback @ plugin:zotlit:359
RK @ app.js:1
e.executeCommand @ app.js:1
eval @ plugin:obsidian-kanban:67
o @ plugin:obsidian-kanban:33
e.executeCommandById @ app.js:1
onChooseSuggestion @ plugin:darlal-switcher-plus:4117
onChooseSuggestion @ plugin:darlal-switcher-plus:4824
onChooseSuggestion @ plugin:darlal-switcher-plus:5591
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
e.onKeyEvent @ app.js:1