Description
It seems that the elm
executable is unable to properly download/parse the docs for elm-geometry
3.4.0 (3.3.0 seems fine), which interferes with diffing/publishing.
SSCCE
If you run
elm diff ianmackenzie/elm-geometry 3.3.0 3.4.0
you should get
-- PROBLEM LOADING DOCS --------------------------------------------------------
I need the docs for 3.4.0 to compute this diff, so I fetched:
https://package.elm-lang.org/packages/ianmackenzie/elm-geometry/3.4.0/docs.json
I got the data back, but it was not what I was expecting. The response body
contains 520257 bytes. Here is the beginning:
[{"name":"Arc2d","comment":" An `Arc2d` is a section of a circle, defined...
Does this error keep showing up? Maybe there is something weird with your
internet connection. We have gotten reports that schools, businesses, airports,
etc. sometimes intercept requests and add things to the body or change its
contents entirely. Could that be the problem?
whereas
elm diff ianmackenzie/elm-geometry 3.2.0 3.3.0
works fine. The docs on the package web site (https://package.elm-lang.org/packages/ianmackenzie/elm-geometry/3.4.0/) seem to load/render fine, so this looks like an issue with the CLI and not the server. I also downloaded the docs.json
file manually from the URL mentioned in the error message above, and it appears to be well-formed (not truncated or anything).
I'm using Elm 0.19.1 on Windows 10, but I also tested on Linux and Mac and got the same error.
Additional Details
I actually first ran into the error when trying to use elm diff
(without arguments) in a local checkout of elm-geometry
to prepare for publishing version 3.5.0; that and elm publish
report the same error as above.
Could this be another issue with docs larger than 512 kb? I took a brief look through the elm/compiler
code and my best guess is that there's some issue with decoding large byte strings using fromByteString
in src/Parse/Primitives.hs
.