[2.0] Problem with assets compilation

134 views
Skip to first unread message

Ben McCann

unread,
Apr 25, 2012, 7:39:00 PM4/25/12
to play-fr...@googlegroups.com
Hi,

The assets compiler is not working for me.  My less files are not being compiled and so my CSS is being served as a 404.  It seems to be because calling relativeTo filters out all the files?  I don't understand exactly what's going on, but here's some variable values that I captured by inserting some System.out.println lines that seem to demonstrate the problem.

PlayCommands - line 311 - changedFiles - List(/home/bmccann/src/connectifier/app/assets/stylesheets/main.less)
PlayCommands - line 298 - src - /home/bmccann/src/connectifier/app
PlayCommands - line 315 - (files x relativeTo(Seq(src / "assets"))) - ArrayBuffer()

Thanks,
Ben

Ben McCann

unread,
Apr 26, 2012, 11:58:58 AM4/26/12
to play-fr...@googlegroups.com
I would really appreciate it if someone could look at this.  I can't deploy any new version of my app with the CSS compilation broken unfortunately.

Thanks,
Ben

Jodson Leandro

unread,
Apr 26, 2012, 1:26:28 PM4/26/12
to play-fr...@googlegroups.com
did you write this line in the your routes file?

GET     /assets/*file                                            controllers.Assets.at(path="/public", file)

and called like that: @routes.Assets.at("stylesheets/main.less") ?

Ben McCann

unread,
Apr 26, 2012, 2:00:41 PM4/26/12
to play-fr...@googlegroups.com
You mean @routes.Assets.at("stylesheets/main.css"), right?  The less file is compiled to CSS.

The problem is definitely with the assets compiler.  The compiled file is never being created due to the line I mentioned earlier.  If I run "find . -name 'main.css'" there's no compiled file to be found.



--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/VQ9SOpQEIRQJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Kevin Bosman

unread,
Apr 26, 2012, 2:10:52 PM4/26/12
to play-fr...@googlegroups.com
> The assets compiler is not working for me.  My less files are not being
> compiled and so my CSS is being served as a 404.

Ben, I'm not seeing the same problem on current master.

For comparison purposes, I have a main.less in app/assets/css, and
straightforward lessEntryPoints as follows:

val main = PlayProject(appName, appVersion, appDependencies, mainLang
= JAVA).settings(
lessEntryPoints <<= baseDirectory(_ / "app" / "assets" / "css" ** "main.less")
)

peter hausel

unread,
Apr 26, 2012, 2:27:24 PM4/26/12
to play-fr...@googlegroups.com
I just tested it various sample apps and I do not see the issue right now. Can you please retest with the latest master? Thanks Peter

Ben McCann

unread,
Apr 26, 2012, 2:37:32 PM4/26/12
to play-fr...@googlegroups.com
Yes, I have been using the latest master.  It started after I did a "play clean-all" yesterday.  Does running "play clean-all" have any affect for you?

Thanks,
Ben


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/Gnzd1J0nehsJ.

Kevin Bosman

unread,
Apr 26, 2012, 2:39:59 PM4/26/12
to play-fr...@googlegroups.com
> Yes, I have been using the latest master.  It started after I did a "play
> clean-all" yesterday.  Does running "play clean-all" have any affect for
> you?

I made sure I did a clean-all before rebuilding.

(I had also just deleted my entire local ivy repository due to the
scala-tools issue having messed that up.)

Kevin Bosman

unread,
Apr 26, 2012, 2:44:38 PM4/26/12
to play-fr...@googlegroups.com
> Yes, I have been using the latest master.  It started after I did a "play
> clean-all" yesterday.  Does running "play clean-all" have any affect for
> you?

Are you sure you have this commit on your local copy?
https://github.com/playframework/Play20/commit/1d6d57361a25e0304ba7aefbdd81768c3c9da18c

Ben McCann

unread,
Apr 26, 2012, 8:52:54 PM4/26/12
to play-fr...@googlegroups.com
I finally tracked down the problem.  A departed member of our team incorrectly changed the lessEntryPoints in Build.scala a week ago so that there was no inputs being passed to the less compiler.  I guess that Play does not delete CSS files which are removed, so it took a week for the problem to show up until any of us ran "play clean-all".  It's also very strange because I synced my project's git repo back a couple weeks before he made that change to check if it was on our end and I still had the problem, so maybe there's some caching of the sbt config happening or something.  I'll try to investigate later to see if I can come up with anything reproducible to demonstrate unexpected caching.

Thank you guys so much for testing the assets compiler and letting me know it works for you.  It was very helpful.



--
You received this message because you are subscribed to the Google Groups "play-framework" group.
Reply all
Reply to author
Forward
0 new messages