Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spago docs failing #752

Closed
cakekindel opened this issue Mar 15, 2021 · 8 comments
Closed

spago docs failing #752

cakekindel opened this issue Mar 15, 2021 · 8 comments
Labels

Comments

@cakekindel
Copy link
Contributor

cakekindel commented Mar 15, 2021

  • OS: Arch linux
  • node v14.16.0
  • npm v6.14.11
  • pulp v15.0.0
  • purs v0.14.0
  • spago 0.19.1

steps to reproduce

1. create repro project

mkdir spago-docs-bug && cd spago-docs-bug && spago init

2. reference arrays in a public item

src/Main.hs

module Main where

import Prelude
import Effect.Console (log)

nums :: Array Int
nums = [1,2,3]

main = log $ show nums

3. generate docs

spago docs

Observed output & errors

Click to expand
Documentation written to: generated-docs/html
Building the search index...
"docs.json" decoding failed failed for output/Data.Generic.Rep/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 6:
  At object key 'typeArguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Symbol"]}'.
"docs.json" decoding failed failed for output/Data.Symbol/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'arguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Symbol"]}'.
"docs.json" decoding failed failed for output/Data.Unit/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}'.
"docs.json" decoding failed failed for output/Effect.Uncurried/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]}]}'.
"docs.json" decoding failed failed for output/Effect/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]}'.
"docs.json" decoding failed failed for output/Prim.Boolean/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Boolean"]}'.
"docs.json" decoding failed failed for output/Prim.Coerce/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'arguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeVar","contents":"k"}'.
"docs.json" decoding failed failed for output/Prim.Ordering/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}'.
"docs.json" decoding failed failed for output/Prim.Row/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'arguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Row"]},{"annotation":[],"tag":"TypeVar","contents":"k"}]}'.
"docs.json" decoding failed failed for output/Prim.RowList/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]}'.
"docs.json" decoding failed failed for output/Prim.Symbol/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'arguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Symbol"]}'.
"docs.json" decoding failed failed for output/Prim.TypeError/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'arguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeConstructor","contents":[["Prim","TypeError"],"Doc"]}'.
"docs.json" decoding failed failed for output/Prim/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 0:
  At object key 'kind':
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]}]}'.
"docs.json" decoding failed failed for output/Type.Proxy/docs.json: An error occurred while decoding a JSON value:
  At object key 'declarations':
  Under 'Array':
  At array index 2:
  At object key 'typeArguments':
  Under 'Array':
  At array index 0:
  Expected value of type 'Couldn't parse Kind from {"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeApp","contents":[{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]},{"annotation":[],"tag":"TypeConstructor","contents":[["Prim"],"Type"]}]}]}'.
Indexing 54 modules from 4 packages...
Added 235 definitions and 174 type definitions from 4 packages to the search index.
@f-f
Copy link
Member

f-f commented Mar 17, 2021

It sounds like this is happening because we need to upgrade docs-search to 0.14? cc @klntsky

@f-f
Copy link
Member

f-f commented Mar 17, 2021

This line seems to be the only relevant addition to Pursuit for 0.14

@klntsky
Copy link
Collaborator

klntsky commented Mar 17, 2021

It sounds like this is happening because we need to upgrade docs-search to 0.14? cc @klntsky

I'm on it.

@f-f
Copy link
Member

f-f commented Mar 17, 2021

It might also be a good idea to add a test that verifies that spago docs succeeds, to make sure that docs-search still works when we update the compiler

@cakekindel
Copy link
Contributor Author

you guys rock! gonna be watching that PR so i can fix similar issues in the future 😄

@cakekindel
Copy link
Contributor Author

By the way incase someone hits this issue before fix is merged, I was able to work around this for the time being by running

pulp docs "src/**/*.purs" ".spago/*/*/src/**/*.purs"

you may also be able to use pulp docs $(spago sources) but I haven't tested this.

@f-f
Copy link
Member

f-f commented Mar 17, 2021

@cakekindel also spago docs --no-search should work

@f-f f-f added the bug label Apr 14, 2021
@f-f
Copy link
Member

f-f commented Apr 20, 2021

Fixed in #775

@f-f f-f closed this as completed Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants