{"action":"opened","issue":{"url":"https://api.github.com/repos/zotero/translation-server/issues/12","labels_url":"https://api.github.com/repos/zotero/translation-server/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/zotero/translation-server/issues/12/comments","events_url":"https://api.github.com/repos/zotero/translation-server/issues/12/events","html_url":"https://github.com/zotero/translation-server/issues/12","id":58068949,"number":12,"title":"csljson export not working","user":{"login":"paddymcall","id":710988,"avatar_url":"https://avatars.githubusercontent.com/u/710988?v=3","gravatar_id":"","url":"https://api.github.com/users/paddymcall","html_url":"https://github.com/paddymcall","followers_url":"https://api.github.com/users/paddymcall/followers","following_url":"https://api.github.com/users/paddymcall/following{/other_user}","gists_url":"https://api.github.com/users/paddymcall/gists{/gist_id}","starred_url":"https://api.github.com/users/paddymcall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddymcall/subscriptions","organizations_url":"https://api.github.com/users/paddymcall/orgs","repos_url":"https://api.github.com/users/paddymcall/repos","events_url":"https://api.github.com/users/paddymcall/events{/privacy}","received_events_url":"https://api.github.com/users/paddymcall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-18T13:42:27Z","updated_at":"2015-02-18T13:42:27Z","closed_at":null,"body":"Hope this is the right place to note this: I tried to export some csljson, but it seems it's not working.\r\n\r\nHere's the server's output:\r\n\r\n```\r\nzotero(3)(+0000000): HTTP server listening on *:1969\r\n\r\nzotero(3)(+0000000): Not initializing HTTP server\r\n\r\nzotero(5)(+0007948): POST /export?format=csljson HTTP/1.1\r\nUser-Agent: curl/7.38.0\r\nHost: localhost:1969\r\nAccept: */*\r\nContent-Type: application/json\r\nContent-Length: 1515\r\nExpect: 100-continue\r\n\r\n\r\n\r\nzotero(4)(+0001001): Translate: Binding sandbox to http://www.example.com/\r\n\r\nzotero(4)(+0000007): Translate: Parsing code for CSL JSON\r\n\r\nzotero(3)(+0000001): Translate: Beginning translation with CSL JSON\r\n\r\nzotero(3)(+0000002): invalid 'instanceof' operand Zotero.Item at chrome://translation-server/content/utilities.js:1483\r\n\r\nzotero(2)(+0000000): Translate: Translation using CSL JSON failed: \r\nstring => TypeError: invalid 'instanceof' operand Zotero.Item\r\nstack => Zotero.Utilities.itemToCSLJSON@chrome://translation-server/content/utilities.js:1483:1\r\nZotero.Translate.SandboxManager.prototype.importObject/attachTo[localKey]@chrome://translation-server/content/translation/translate_firefox.js:533:8\r\ndoExport@CSL JSON:71:29\r\nZotero.Translate.Base.prototype._translateTranslatorLoaded@chrome://translation-server/content/translation/translate.js:1189:4\r\nZotero.Translate.Base.prototype.translate/</<@chrome://translation-server/content/translation/translate.js:1162:51\r\nZotero.Translate.Base.prototype._loadTranslator@chrome://translation-server/content/translation/translate.js:1512:16\r\nZotero.Translate.Base.prototype.translate/<@chrome://translation-server/content/translation/translate.js:1162:7\r\nZotero.Translators</this.get@chrome://translation-server/content/connector/translator.js:124:4\r\nZotero.Translate.Base.prototype.translate@chrome://translation-server/content/translation/translate.js:1160:1\r\nZotero.Translate.Export.prototype.translate@chrome://translation-server/content/translation/translate.js:2208:3\r\nZotero.Server.Translation.Export.prototype.init@chrome://translation-server/content/server_translation.js:441:3\r\nZotero.Server.DataListener.prototype._processEndpoint@chrome://translation-server/content/server.js:412:4\r\nZotero.Server.DataListener.prototype._bodyData@chrome://translation-server/content/server.js:314:3\r\nZotero.Server.DataListener.prototype.onDataAvailable@chrome://translation-server/content/server.js:187:3\r\n@translation-server/init.js:134:14\r\n\r\nurl => undefined\r\ndownloadAssociatedFiles => undefined\r\nautomaticSnapshots => undefined\r\n\r\nzotero(5)(+0000000): Translate: Running handler 0 for done\r\n\r\nzotero(5)(+0000000): HTTP/1.0 500 Internal Server Error\r\nContent-Type: text/plain\r\n\r\nAn error occurred during translation. Please check translation with Zotero client.\r\n```\r\n\r\nI tried it with the Zotero client, and it works. So I'm thinking it might be a problem of the translation_server. \r\n\r\nHow to reproduce: \r\n\r\nI edited server_translation.js to enable csljson export, adding:\r\n\r\n```\r\nconst SERVER_FORMATS = { ...,\r\n        \"csljson\":\"bc03b4fe-436d-4a1f-ba59-de4d2d7a63f7\"\r\n};\r\n\r\nconst SERVER_CONTENT_TYPES = {...,\r\n        \"csljson\":\"application/json\"\r\n};\r\n```\r\n\r\nThen after ./build.sh, I can get some zoterojson data:\r\n\r\n```\r\ncurl -d '{\"url\":\"http://www.tandfonline.com/doi/abs/10.1080/15424060903167229\",\"sessionid\":\"abc123\"}'       --header \"Content-Type: application/json\"       localhost:1969/web > /tmp/sample_data.json\r\n```\r\n\r\nEdit /tmp/sample_data.json so that it's an array (remove outermost `[]').\r\n\r\nUsing that, I try to generate csljson:\r\n\r\n```\r\ncurl -d @/tmp/sampledata.json       --header \"Content-Type: application/json\"  localhost:1969/export?format=csljson\r\n```\r\n\r\nAnd this throws the error above. Most of the other formats work fine (not tei, though).\r\n\r\nAlso, if I edit \ttranslation-server/content/utilities.js:1483 to say,\r\n\r\n```\r\nif(typeof Zotero.Item !== 'undefined' && item instanceof Zotero.Item) {\r\n```\r\n\r\nthen it works. So maybe something is not being initialized properly?"}}