zotero / zotero-connectors

Chrome, Firefox, Edge, and Safari extensions for Zotero
https://www.zotero.org/download/connectors
Other
480 stars 119 forks source link

"Error: getTranslators: detection is already running" when localhost web development #435

Open sheldonmaschmeyer opened 1 year ago

sheldonmaschmeyer commented 1 year ago

I usually have Zotero disabled on localhost when creating a React or Vue app but, when it is enabled, this error appears in the console.

caught (in promise) Error: getTranslators: detection is already running
    at Zotero.Translate.Web.<anonymous> (translate.js:1091:45)
    at Zotero.Translate.Web.getTranslators (promise.js:36:17)
    at Object.init (inject.js:106:25)
dstillman commented 1 year ago

I'm not really sure what you're reporting here. Can you provide Steps to Reproduce?

sheldonmaschmeyer commented 1 year ago

I cannot show exact steps. However, the error message in the console also appears in production, on a hosted website. I do not normally have the developer console open in Chrome when browsing websites so I cannot say if sometimes occurs on other sites. It appears on upon loading of the site but not consistently.

asmaloney commented 1 year ago

Just another data point: I'm getting this on my local dev environment as well. I'm running vue 2.7.14 in docker on a Mac.

Edit: Additional info:

It should probably disable itself when the URL is localhost anyways?

AbeJellinek commented 1 year ago

Could you provide exact steps to reproduce? I don't understand what exactly you're doing outside of Zotero that is triggering that message.

AbeJellinek commented 1 year ago

Oh, do you mean you're navigating to a URL hosted on localhost in a browser with the Connector installed, and when you do, that error appears in the console?

asmaloney commented 1 year ago

do you mean you're navigating to a URL hosted on localhost in a browser with the Connector installed, and when you do, that error appears in the console?

Yes - that's what I was seeing when developing a vue-based site locally (without the Zotero application running), but it doesn't seem to happen all the time? I just fired up everything from scratch (docker, my web app, the browser) and now I'm not seeing it. Maybe it was fixed by something in the latest release (I can't find release notes)?

I will keep an eye on it and add info here if it comes up again.

Or... is there an option to the connector to tell it to turn itself off when browsing localhost?

Thanks @AbeJellinek!