zotero / translation-server

A Node.js-based server to run Zotero translators
Other
123 stars 52 forks source link

TypeError: Cannot read property 'replace' of undefined #30

Closed mvolz closed 6 years ago

mvolz commented 6 years ago

I get the error for the url http://pediatrics.aappublications.org/cgi/doi/10.1542/peds.2007-2362. Fortunately it is able to continue translation after encountering this error.

(2)(+0000003): Translate: Detect using COinS failed: TypeError: Cannot read property 'replace' of undefined

TypeError: Cannot read property 'replace' of undefined at Zotero.Utilities.Translate.parseContextObject (/home/marielle/Code/translation-server-v2/modules/zotero/chrome/content/zotero/xpcom/openurl.js:312:45) at Function.parseContextObject (/home/marielle/Code/translation-server-v2/src/translation/sandboxManager.js:91:17) at detectWeb (eval at (/home/marielle/Code/translation-server-v2/src/translation/sandboxManager.js:65:4), :33:34) at Zotero.Translate.Web._detectTranslatorLoaded (/home/marielle/Code/translation-server-v2/modules/zotero/chrome/content/zotero/xpcom/translation/translate.js:1741:47) at Zotero.Translate.Web. (/home/marielle/Code/translation-server-v2/modules/zotero/chrome/content/zotero/xpcom/translation/translate.js:1725:16) at at process._tickCallback (internal/process/next_tick.js:188:7) url => http://rspb.royalsocietypublishing.org/content/267/1453/1627

dstillman commented 6 years ago

That happens in the Zotero Connector too, so this isn't a translation-server issue. (I'm not sure why the COinS detect fails — possibly invalid COinS on the page — but the connector saves successfully via HighWire 2.0 anyway.)

The main problem here for this URL is just that it's detecting on the pre-redirect URL, so the HighWire 2.0 translator doesn't fire. We'll deal with that in https://github.com/zotero/translation-server-v2/issues/21.