zotero-plugin-template
zotero-plugin-template copied to clipboard
zotero not able to find the boostrap methods
Still having some problems getting the examples running. When I enable/disable the plugin in Zotero, the console says that it can't find the bootstrap methods for startup & shutdown. No doubt I've done something wrong here in my repo?
Thx.
package.json
"config": {
"addonName": "Zotero Reporter",
"addonID": "[email protected]",
"addonRef": "zotero-reporter",
-- "addonInstance": "Zotero.${addonInstance}",
-- "prefsPrefix": "extensions.zotero.${addonRef}",
++ "addonInstance": "Reporter",
++ "prefsPrefix": "extensions.zotero.reporter",
"releasePage": "https://github.com/carljoseph/zotero-reporter/releases",
"updateJSON": "https://raw.githubusercontent.com/carljoseph/zotero-reporter/main/update.json"
},
https://github.com/carljoseph/zotero-reporter/blob/7dfc936a63c4f64f8d4bf202aaf5d2964285b3f7/package.json#L9-L10
The addonInstance
should be a valid JS variable name and addonRef
should be a valid CSS and Fluent string
(and prefsPrefix
may have limitation to symbols, not sure - but extensions.zotero.${addonRef}
is definitely not a good idea, since the string ${addonRef}
does not represents your plugin.
++ "addonInstance": "Reporter",
Emm... Zotero.Reporter
might not be a good definition for me. Maybe ReporterPlugin
or something that's less likely to cause conflict?
BTW, the plugin name Zotero Reporter
is not a very good idea, since Zotero
is a registered trademark and the team suggests plugin developers not to use a name like Zotero XYZ
, instead use XYZ for Zotero
, to not mislead users that it's an official Zotero software. (The GitHub repo name can be an exception since it's not for users)
Emm... Zotero.Reporter might not be a good definition for me. Maybe ReporterPlugin or something that's less likely to cause conflict?
Indeed, I was just trying to express that it's here that there is a issue, and ignoring this word easily leads to confusion.
Thanks for your patience and help folks. Have changed the naming of the plugin, etc. but I'm still getting the same console error.
I'm new to this, and basically trying to get the plugin template examples working to get me started. Thx
Already restarted Zotero and dev servers? (kill zotero and re-run npm start
)
Yep, indeed. Here's what it looks like (with Zotero not started at the beginning) ...
https://github.com/windingwind/zotero-plugin-template/assets/4588120/5aa71a52-64bf-4e07-b903-bf323fe09a8c
Trying to get these examples running. Happy to admit if this is beyond me at the moment and if there may be a more straightforward way ¯_(ツ)_/¯
but it's running for me.
use a beta version zotero?
let me see your build/addon/bootstrap.js
?
Yeah, using the latest beta version of Zotero 7. bootstrap.js
is unchanged - https://github.com/carljoseph/zotero-reporter/blob/main/addon/bootstrap.js
All I changed was the config
section in the package.json
I guess, please quit Zotero completely, mac systems need to be quit manually by right clicking on the tray icon, not just closing the main window.
Definitely quit. No presence of it in activity monitor either. Might start from scratch again and see what happens ¯_(ツ)_/¯
try restart pc (An attempt that seems silly but works most of the time.
Unfortunately no change :(
Just reverted back to the start. When I download the plugin template code, update the zotero-cmd.json
, do the whole npm install
, npm run build
, npm start
and I get the same error in Zotero.
However, if I install the .xpi plugin itself after building it, it works fine ¯_(ツ)_/¯
Please check the plugin directory if it's an xpi
or the text file linking to the dev build. I guess if you manually installed a plugin from xpi, the npm run start
will not be able to overwrite it to the dev build.
Thanks for the idea. I set up a completely new profile in Zotero and still get the same problem :(
Enable the plugin if it was disabled, then quit Zotero and run npm start
again.
Enable the plugin if it was disabled, then quit Zotero and run
npm start
again.
Now why did that do the trick?! Thank you!!
So here's the full process to get it to work ...
- Create a new Zotero profile
zotero -p
- Manually create the
extensions
folder in your profile directory '/Users/user.name/Library/Application Support/Zotero/Profiles/1e736rli.dev2/extensions/(for some reason
npm start` fails if it doesn't already exist) - Update
zotero-cmd.json
-
npm start
- Enable the plugin
- Shut down Zotero
-
npm start
again
Thank you everyone for your patience and help with this.
Should be fixed in the latest plugin template.