windingwind / zotero-pdf-translate

Translate PDF, EPub, webpage, metadata, annotations, notes to the target language. Support 20+ translate services.
GNU Affero General Public License v3.0
6.06k stars 301 forks source link

[Bug] extension built on commit a859ecc failed to popup. #759

Closed Lslightly closed 6 days ago

Lslightly commented 1 month ago

Is there an existing issue for this?

Have you checked the FAQ (https://github.com/windingwind/zotero-pdf-translate/issues/6)?

Are you using the latest Zotero and the latest plugin?

Environment

Describe the bug

The released extension at github release can popup the translation but the generated version can not.

steps to reproduce the bug.

git clone https://github.com/windingwind/zotero-pdf-translate.git
cd zotero-pdf-translate
git checkout z6
git reset --hard a859ecc

Then change the devDependencies in package.json by replacing all ^ with empty string. The reason is that ^ will use the newest version of dependency, whose interfaces have changed. Especially, zotero-types has many differences between 1.0.13 and 1.3.20. Then build the extension.

npm install
npm run build

Then install this extension in zotero and restart the zotero. After that, disable and then re-enable the extension to make the settings of the extension available in the preference menu of zotero. Use the following settings.

image

Then select a word in English and there is no popup. See the following image.

image

Debug Output

[JavaScript Error: "WeakRef is not defined" {file: "resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js" line: 7242}] createElement@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:7242:17 addStyle@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9857:25 initializeUI@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9402:11 node_modules/zotero-plugin-toolkit/dist/managers/prompt.js/Prompt<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:9396:11 node_modules/zotero-plugin-toolkit/dist/managers/prompt.js/PromptManager2<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:10027:36 ZToolkit<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14182:21 Addon<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14150:19 @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:14209:25 @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/index.js:2:1 startup@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/Lslightly/AppData/Roaming/Zotero/Zotero/Profiles/chia1tlx.default/extensions/zoteropdftranslate@euclpts.com.xpi!/bootstrap.js:94:3

Anything else?

No response

windingwind commented 1 month ago

You may check the version of zotero-plugin-toolkit. It should be <2.1.8