jgm / pandoc-citeproc

Library and executable for using citeproc with pandoc
BSD 3-Clause "New" or "Revised" License
291 stars 61 forks source link

pandoc-citeproc: Error in $: Incompatible API versions: encoded with [1,21] but attempted to decode with [1,20]. #448

Closed njbart closed 4 years ago

njbart commented 4 years ago

MWE (using latest dev versions of pandoc and pandoc-citeproc, installed as described here):

pandoc -s -F pandoc-citeproc -t plain << EOT

Foo [@item1].

---
references:
- id: item1
  type: book
  title: The title
...
EOT

Output:

pandoc-citeproc: Error in $: Incompatible API versions: encoded with [1,21] but attempted to decode with [1,20].
CallStack (from HasCallStack):
  error, called at ./Text/Pandoc/JSON.hs:112:48 in pandoc-types-1.20-BUPf2Tq5atP8Lb94Ld23Jj:Text.Pandoc.JSON
Error running filter pandoc-citeproc:
Filter returned error status 1
jgm commented 4 years ago

This happens when you use a filter (in this case pandoc-citeproc) that is compiled against a different version of pandoc-types than pandoc.

Solution is to build them both at once. You can do that by cloning the pandoc repository and doing stack install pandoc pandoc-citeproc. Or just grab a nightly from the Actions tab; these contain both pandoc and pandoc-citeproc.

Meanwhile we should update the build info here.

lakonis commented 4 years ago

I have the same problem with the following versions of pandoc and pandoc-citeproc:

pandoc 2.11
Compiled with pandoc-types 1.22, texmath 0.12.0.3, skylighting 0.10.0.2
pandoc-citeproc 0.15.0.1

I tried to build them both at once :

$ stack install pandoc pandoc-citeproc
Downloading lts-16.22 build plan ...
RedownloadInvalidResponse Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-16.22.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 "/home/nicolas/.stack/build-plan/lts-16.22.yaml" (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Connection","keep-alive"),("Content-Length","14"),("Content-Type","text/plain; charset=utf-8"),("Content-Security-Policy","default-src 'none'; style-src 'unsafe-inline'; sandbox"),("Strict-Transport-Security","max-age=31536000"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","deny"),("X-XSS-Protection","1; mode=block"),("Via","1.1 varnish (Varnish/6.0), 1.1 varnish"),("X-GitHub-Request-Id","C4EC:13A6F:227812B:2427F91:5FB38AF7"),("Accept-Ranges","bytes"),("Date","Tue, 17 Nov 2020 08:33:59 GMT"),("X-Served-By","cache-cdg20720-CDG"),("X-Cache","MISS, MISS"),("X-Cache-Hits","0, 0"),("X-Timer","S1605602040.703692,VS0,VE150"),("Vary","Authorization,Accept-Encoding"),("Access-Control-Allow-Origin","*"),("X-Fastly-Request-ID","ef697c1e9e9663b41cc52457b5fdc9ca17f710f0"),("Expires","Tue, 17 Nov 2020 08:38:59 GMT"),("Source-Age","0")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose})

Any idea how to solve this ? thank !

tarleb commented 4 years ago

pandoc-citeproc is no longer needed when using pandoc 2.11. See the changelog of that version.