开发者

Grails: Images / CSS missing from time to time

While developing a website I experience a weird bug. From time to time my images or my css are missing.

It's not really predictable and therefore not reproducible.

Usually it happens after I edit my css, save it and reload the page (in the browser).

It's always syntactical correct CSS, so no compilation erros or anything similar.

I think it's the way Grails updates the running application, but I really can't say why or where it happens as it is quite rarely, but def开发者_如何学编程initely annoying.

It doesn't matter if I run the application with my IDE (IntelliJ 9.0.4) or with the commandline (Windows).

The only thing I did not test so far is whether it happens only when I use the IDE or not.

Did anyone experience this?

EDIT: Sorry for an unclear description: "missing" means the browser is unable to load the corresponding ressource: "The Ressource () is not available"

Another Edit:

Thanks for the comments so far. In addition to my main css-file and my images, which change quite frequently, my reset-css-file disappeared. I never touched it since creation, so I think one can exclude the compilation-script as cause of this mess. (further info in the comments)


Like John Smith I arrived here googling for this problem. But I found another solution, and i hope that it helps you too.

I googled a little bit more and found this discussion Disabling static resource stuff, here i found a contributor of grails application, and author of Resources Plugin, Mark Palmer (take a look his website), telling what he is doing and answering the questions about this plugin.

Today, all you need to do is to update the Resources Plugin to version 1.2-RC1 or a recent one that will fix this problem.


When you say missing, do you mean that the changes are missing, or the whole stylesheet is missing? If it is just your latest changes, it is possible that your browser is caching the previous css file and isn't getting the latest changes. Try doing a "hard refresh" with something like CTRL+F5, or whatever hard refresh is in the browser that you are using. This will force a pull of the latest resources.


Really old question.. but for anybody googling this - I had similar issues with my CSS because of Windows file format on the Linux systems. Once I changed the format to unix, I still had to restart the server for the css to download. Note that somehow the css were downloading earlier although the format was windows and the issue was intermittent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜