Hamlet templates doesn't update

63 views
Skip to first unread message

Дмитрий Долгов

unread,
Jun 17, 2013, 9:17:02 AM6/17/13
to yeso...@googlegroups.com

I'm new in Yesod. I have strange problem (i asked about this on reddit and stackoverflow, but nothing) - I have created new Yesod application with cabal-dev:

yesod init

and tried modify templates/homepage.hamlet . When I restarted development service, I didn't see my changes) When I have deployed this app into Heroku, there is my changes well. I don't know reason of this - can anybody help me?

Greg Weber

unread,
Jun 17, 2013, 9:32:57 AM6/17/13
to Yesod Web Framework
So we are assuming you are using `yesod --dev devel`. You should be able to manually run `cabal-dev build` to see your changes. Also, if you touch a file that uses templates/homepage.hamlet the changes should show up. Do those work?


--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Дмитрий Долгов

unread,
Jun 18, 2013, 4:52:32 AM6/18/13
to yeso...@googlegroups.com
I have ran 'cabal-dev build' (also 'yesod build --dev', but i think, this commands are equals) - my application was rebuilt, but it still didn't contains my template changes. Also, I have changed page title in getHomeR handler, rebuild app, and nothing! And yes, I use 'yesod --dev devel' to run development server. 

понедельник, 17 июня 2013 г., 20:32:57 UTC+7 пользователь Greg Weber написал:

Greg Weber

unread,
Jun 18, 2013, 7:08:15 AM6/18/13
to Yesod Web Framework
This is very strange. Can you generate a new site with `yesod init` and not change anything at all, but just try to modify one of the templates and verify that you still don't see any changes?
What version of ghc are you using?

Дмитрий Долгов

unread,
Jun 18, 2013, 8:22:24 AM6/18/13
to yeso...@googlegroups.com
I found solution, but it's surprisingly for me)
I have generated new app with postgresql:

yesod init
cd TestChange
cabal-dev install

modified homepage.hamlet:

+<h1>Test change
<h1>_{MsgHello}

and run dev server:

yesod --dev devel

Yesod devel server. Press ENTER to quit
Warning: The package list for 'hackage.haskell.org' is 16 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring TestChanges-0.0.0...
Forcing recompile for ./Handler/Home.hs because of templates/homepage.hamlet
Forcing recompile for ./Handler/Home.hs because of templates/homepage.julius
Forcing recompile for ./Handler/Home.hs because of templates/homepage.lucius
Rebuilding application... (using cabal-dev)
Starting development server...
Starting devel application
Devel application launched: http://localhost:3000

And I don't see any changes. After 'cabal-dev build' nothing has changed. But when i run

cabal-dev install

and start dev server, template modifications were i place!) This is correct behavior of yesod?

вторник, 18 июня 2013 г., 18:08:15 UTC+7 пользователь Greg Weber написал:

Greg Weber

unread,
Jun 19, 2013, 12:28:46 AM6/19/13
to Yesod Web Framework
The instruction to run cabal-dev install is given in the output of yesod init.

But still, this should be easy for yesod --dev devel to detect so I created an issue for it: https://github.com/yesodweb/yesod/issues/565

Дмитрий Долгов

unread,
Jun 19, 2013, 1:22:05 AM6/19/13
to yeso...@googlegroups.com
Hm...but when I ran 'yesod --dev devel' cabal-dev directory already exists, because I created app as:

yesod init
cd TestChange
cabal-dev install 

Or am I missing something?

среда, 19 июня 2013 г., 11:28:46 UTC+7 пользователь Greg Weber написал:

Greg Weber

unread,
Jun 19, 2013, 10:28:23 AM6/19/13
to Yesod Web Framework
Those commands should work (yesod --dev devel would come after). Can you update the github issue with the exact commands that create the issue?
Reply all
Reply to author
Forward
0 new messages