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

widgetFileReload cannot find "templates" directory when loaded from another dir #1690

Closed
dten opened this issue Aug 6, 2020 · 4 comments · Fixed by #1691
Closed

widgetFileReload cannot find "templates" directory when loaded from another dir #1690

dten opened this issue Aug 6, 2020 · 4 comments · Fixed by #1691

Comments

@dten
Copy link
Contributor

dten commented Aug 6, 2020

When you have a multi package project and one of the packages uses yesod and uses widgetFileReload if you stack ghci from the project root or similar then it won't compile because a relative path is used which expect you are loading from the yesod using package's root. but in this case we're not

http://hackage.haskell.org/package/yesod-1.6.0.2/docs/src/Yesod.Default.Util.html#globFile

would you be open to using pathRelativeToCabalPackage https://hackage.haskell.org/package/th-utilities-0.2.0.1/docs/TH-RelativePaths.html#v:pathRelativeToCabalPackage or something similar in yesod so that these are converted to absolute paths?

@snoyberg
Copy link
Member

snoyberg commented Aug 6, 2020

Yes, though I'd rather not add an additional dependency. Does this function fulfill the need? https://www.stackage.org/haddock/nightly-2020-08-03/file-embed-0.0.13.0/Data-FileEmbed.html#v:makeRelativeToProject

@dten
Copy link
Contributor Author

dten commented Aug 6, 2020

Yes that's perfect 😁

@dten
Copy link
Contributor Author

dten commented Aug 7, 2020

i tried this but it seems not to work because of course the code is in the yesod package so the paths end up relative to yesod.cabal 😓

@dten
Copy link
Contributor Author

dten commented Aug 7, 2020

#1691
got something that works but had to add an alternative to globFile which remains in a Q Exp that can be evaluated outside of the yesod package

@dten dten mentioned this issue Aug 7, 2020
5 tasks
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