agrafix / Spock

Another Haskell web framework for rapid development
https://www.spock.li
679 stars 56 forks source link

Getting Started build errors #182

Closed aleeusgr closed 1 year ago

aleeusgr commented 1 year ago

Hi! I am following this tutorial with minor tweaks:

  1. I added dependencies into package.yml, not Spock-example.cabal
  2. I added following code to stack.yml as suggested here
    nix:                         
      enable: true                                               
      packages: [zlib.dev, zlib.out]

    now I get following error on stack build --fast --pedantic:

    -- While building package primitive-extras-0.8 (scroll up to its section to see the error) using: primitive-extras > Ambiguous occurrence ‘singleton’ primitive-extras > It could refer to primitive-extras > either ‘PrimitiveExtras.Prelude.singleton’, primitive-extras > imported from ‘PrimitiveExtras.Prelude’ at library/PrimitiveExtras/Bitmap. hs:25:1-70 primitive-extras > (and originally defined in ‘base-4.15.1.0:Data.OldList’) primitive-extras > or ‘PrimitiveExtras.Bitmap.singleton’, primitive-extras > defined at library/PrimitiveExtras/Bitmap.hs:53:1 primitive-extras > | primitive-extras > 5 | singleton, primitive-extras > | ^^^^^^^^^

My system is Linux nixos 5.15.70 stack --version: 2.7.5 x86_64 hpack-0.34.7 The Glorious Glasgow Haskell Compilation System, version 9.0.2 More info Please help me debug this. Thank you

aleeusgr commented 1 year ago

I got a suggestion to bump versions of packages. I changed stack.yml like so:

resolver: lts-19.28

extra-deps:
 10   - Spock-0.14.0.0
 11   - Spock-core-0.14.0.0

now I get

error: (42 results) [35/1870] Spock-core > • Couldn't match type: forall a.
Spock-core > ActionCtxT ctx m a -> ActionCtxT () m a
Spock-core > with: ActionCtxT ctx m () -> ActionCtxT () m ()
Spock-core > Expected: LiftHooked ctx m -> ActionCtxT ctx m () -> ActionT m ()
Spock-core > Actual: LiftHooked ctx m
Spock-core > -> forall a. ActionCtxT ctx m a -> ActionCtxT () m a
Spock-core > • In the first argument of ‘asks’, namely ‘unLiftHooked’
Spock-core > In the second argument of ‘($)’, namely ‘asks unLiftHooked’
Spock-core > In a stmt of a 'do' block: hookLift <- lift $ asks unLiftHooked Spock-core > • Relevant bindings include Spock-core > action :: [T.Text] -> ActionCtxT ctx m () Spock-core > (bound at src/Web/Spock/Core.hs:78:15) Spock-core > wireAny :: SpockMethod Spock-core > -> ([T.Text] -> ActionCtxT ctx m ()) -> SpockCtxT ctx m () Spock-core > (bound at src/Web/Spock/Core.hs:78:5) Spock-core > |
Spock-core > 80 | do hookLift <- lift $ asks unLiftHooked Spock-core > | ^^^^^^^^^^^^ Spock-core >
Spock-core > /run/user/1000/stack-87827ee7c5625bb0/Spock-core-0.14.0.0/src/Web/Spock/Core.hs:106:32: error:

aleeusgr commented 1 year ago

fixed with $stack new template