I'm using yesod version 1.4.0 within a cabal sandbox.
I have the following routes file:
/static StaticR Static getStatic
/auth AuthR Auth getAuth
/favicon.ico FaviconR GET
/robots.txt RobotsR GET
/ HomeR GET POST
/config/#String MakeConfigR GET POST
and a matching (properly imported and everything) handler file for the implementation.
However, whenever yesod (or when I manually) try to compile, I get the following error
Foundation.hs:48:1:
Illegal view pattern: fromPathPiece -> Just dyn_abDD
Use -XViewPatterns to enable view patterns
I haven't modified Foundation.hs in any way.
When I only have a route that takes no parameters, such as
/noparamshere NoParamsR GET
or something similar in my routes file, everything works fine. What have I done wrong?
I guess you have created your project with an old version of yesod. As of yesod-1.4.0, you need to enable ViewPatterns
extension as the error message indicates. Add ViewPatterns
to default-extensions
in your cabal file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With