windingwind / zotero-plugin-toolkit

Toolkit for Zotero Plugin Developers.
https://www.npmjs.com/package/zotero-plugin-toolkit
MIT License
115 stars 13 forks source link

globalCache is undefined #64

Closed Dominic-DallOsto closed 1 month ago

Dominic-DallOsto commented 1 month ago

Hi, I recently had this issue (https://github.com/Dominic-DallOsto/zotero-reading-list/issues/58) where my plugin is unable to startup with the error: globalCache is undefined. It seems this only happens when multiple plugins are installed that use zotero-plugin-toolkit, and disabling all other plugins solves the problem.

Please see these issues for more details:

Could it be that having multiple instances of zotero-plugin-toolkit running somehow causes conflicts?

northword commented 1 month ago

Bump the version of toolkit to v4. It may be fixed in https://github.com/windingwind/zotero-plugin-toolkit/commit/22c78991580140a2f39dee9841d5f077d3191473 .

In addition, importing toolkit on demand is highly recommended, which will help reduce the size of the built scripts and also reduce conflicts. See: https://github.com/northword/zotero-format-metadata/blob/main/src/utils/ztoolkit.ts

lifan0127 commented 1 month ago

I confirm that upgrading toolkit fixed the issue for my plugin. https://github.com/lifan0127/ai-research-assistant/commit/b8b7d6d3aa1b09ffd559b4ac859719a76397dd1c

Dominic-DallOsto commented 1 month ago

Perfect, thanks a lot! This seems to have solved the issue!