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

test/YesodCoreTest/SubSub.hs:21:10: error: • No instance for (RenderRoute App) #1811

Closed
juhp opened this issue Jul 26, 2023 · 2 comments · Fixed by #1812
Closed

test/YesodCoreTest/SubSub.hs:21:10: error: • No instance for (RenderRoute App) #1811

juhp opened this issue Jul 26, 2023 · 2 comments · Fixed by #1812

Comments

@juhp
Copy link

juhp commented Jul 26, 2023

Testsuite failing: I tried for build yesod-core-1.6.24.3 tests for Fedora (basically Stackage lts-21):

test/YesodCoreTest/SubSub.hs:21:10: error:
    • No instance for (RenderRoute App)
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Yesod App’
   |
21 | instance Yesod App
   |          ^^^^^^^^^

So I will just disable the testsuite.

@jezen
Copy link
Member

jezen commented Jul 26, 2023

Interestingly, this fails all the nightly-2022-02-11 checks but passes with older resolvers.

https://github.com/yesodweb/yesod/actions/runs/5500071001/job/14968314065?pr=1805

This change came from #1805 which was merged a couple of weeks ago.

We should probably update the CI configuration to run checks with more recent resolvers.

@jezen
Copy link
Member

jezen commented Jul 26, 2023

Ok, so this is the same problem as this: https://stackoverflow.com/questions/73719275/evaluation-of-template-haskell-in-yesod?noredirect=1&lq=1.

So the fix for this looks like:

diff --git a/yesod-core/test/YesodCoreTest/SubSub.hs b/yesod-core/test/YesodCoreTest/SubSub.hs
index 2c3ad06c..4f02d48b 100644
--- a/yesod-core/test/YesodCoreTest/SubSub.hs
+++ b/yesod-core/test/YesodCoreTest/SubSub.hs
@@ -18,6 +18,10 @@ import YesodCoreTest.SubSubData
 
 data App = App { getOuter :: OuterSubSite }
 
+mkYesod "App" [parseRoutes|
+/ OuterSubSiteR OuterSubSite getOuter
+|]
+
 instance Yesod App
 
 getSubR :: SubHandlerFor InnerSubSite master T.Text
@@ -29,10 +33,6 @@ instance YesodSubDispatch OuterSubSite master where
 instance YesodSubDispatch InnerSubSite master where
   yesodSubDispatch = $(mkYesodSubDispatch resourcesInnerSubSite)
 
-mkYesod "App" [parseRoutes|
-/ OuterSubSiteR OuterSubSite getOuter
-|]
-
 app :: App
 app = App { getOuter = OuterSubSite { getInner = InnerSubSite }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants