You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mainForm :: (MonadCall t m, MonadWidget t m) => m ()
mainForm = do
ck <- getCookie
...
The getCookie functon is:
cookie :: JSM Text
cookie = document ^. js (t_ "cookie") >>= fromJSValUnchecked
getCookie :: MonadWidget t m => m Text
getCookie = liftJSM cookie
But I get the error:
error:
• Could not deduce: DomBuilderSpace m ~ GhcjsDomSpace
arising from a use of ‘mainForm’
from the context: ObeliskWidget t (R FrontendRoute) m
bound by a type expected by the context:
forall t (m :: * -> *).
ObeliskWidget t (R FrontendRoute) m =>
RoutedT t (R FrontendRoute) m ()
at /home/romefeller/weivi/weivi-frontend-poc/frontend/src/Frontend.hs:(24,22)-(25,38)
or from: a ~ ()
I'm unsure how to circumvent this error (I do not remember), as it seems to involve a mismatch between the expected DOM environment and what's provided by my ObeliskWidget setup. Has anyone faced a similar issue or can offer guidance on making mainForm compatible within this context?
Thanks in advance for any help or insights!
The text was updated successfully, but these errors were encountered:
You are seeing a type error because one can only run JSM inside the second argument of prerender as the first is statically rendered by the backend and does not have JS access.
If I have this function:
mainForm :: (MonadCall t m, MonadWidget t m) => m ()
mainForm = do
ck <- getCookie
...
The getCookie functon is:
cookie :: JSM Text
cookie = document ^. js (t_ "cookie") >>= fromJSValUnchecked
getCookie :: MonadWidget t m => m Text
getCookie = liftJSM cookie
But I get the error:
error:
• Could not deduce: DomBuilderSpace m ~ GhcjsDomSpace
arising from a use of ‘mainForm’
from the context: ObeliskWidget t (R FrontendRoute) m
bound by a type expected by the context:
forall t (m :: * -> *).
ObeliskWidget t (R FrontendRoute) m =>
RoutedT t (R FrontendRoute) m ()
at /home/romefeller/weivi/weivi-frontend-poc/frontend/src/Frontend.hs:(24,22)-(25,38)
or from: a ~ ()
where:
frontend_body = subRoute $ \case
FrontendRoute_Main -> mainForm
I'm unsure how to circumvent this error (I do not remember), as it seems to involve a mismatch between the expected DOM environment and what's provided by my ObeliskWidget setup. Has anyone faced a similar issue or can offer guidance on making mainForm compatible within this context?
Thanks in advance for any help or insights!
The text was updated successfully, but these errors were encountered: