Closed nicolai86 closed 11 years ago
Hi @nicolai86,
This was not clear to me from your description: did you regenerate the assets in the private gem? All the templates your app uses need to be regenerated.
@leshill I've updated the ticket with a more accurate problem description. My first take on it was actually wrong.
Hi @nicolai86,
I am not familiar with that setup, but from looking at the compiler info we can see that the gem templates are not using the latest gem. Some possibilities:
handlebars_assets
?public/assets
?Hey @leshill ,
since public/assets is empty and the gem is also declaring handlebars_assets 0.12.1 inside the gemspec I guess it's due to out of date templates. I'm the maintainer of that gem - so how do I force the templates to be regenerated without touching each and every one of them?
Hi @nicolai86,
Since the situation is opaque to me: where exactly are the out-of-date precompiled templates? Inside the gem? Inside the app somewhere? Somewhere else (cloudfront etc)?
Hey @leshill
well that's kind of confusing to me, too. The raw templates are inside the gem, but they should be precompiled inside the app since it's requiring the templates using the asset pipeline. So the app is serving the out-of-date precompiled templates.
what's confusing me is that changing the templates inside the gem solves my problem, while clearing the asset cache does not. how can that be? :(
If you are in development mode, the files are cached in tmp/cache/assets, clear that directory out.
That is a good question. You need to identify where the assets are coming from :(
I guess I'll settle with changing all templates, since that solves my problem for now.
One interesting observation though:
First, I'm removing the tmp/cache directory:
rm -fr /tmp/cache/
Now, I'm using cURL to request a template from my gem, but the asset cache directory has not been recreated.
looks like javascript files from external resources are handled differently. The log only reads
Started GET "/assets/templates/fail_bowl_template.js?body=1" for 127.0.0.1 at 2013-05-25 00:15:39 +0200
Served asset /templates/fail_bowl_template.js - 200 OK (0ms)
This puzzles me - since if they are not cached, why would I get stale compilerInfos ?
There's some magic going on I can't understand right now. :(
oh, and thanks for your fast help! you are awesome, @leshill
Hi @nicolai86,
If you ever resolve exactly what was happening, please add it to this issue :)
hey there
just some days ago I upgraded to handlebars_assets 0.12.1 and now I've got a problem with wrong compilerInfo being generated.
I've got a private gem (really just a rails engine file and some templates) and all templates from within the gem are generated with the old compilerInfo,
[2, 1.0.0.rc3]
, causing handlebars to raise an exception.Here's a accurate summary:
I'm using an initializer to change HandlebarsTemplates to JST:
inside my application.coffee I'm requiring the main file from inside my own gem:
the main file in my gem actually requires all necessary templates:
Now to the interesting parts: The app & the gem contain templates -
all templates inside the main application get the following, correct compilerInfo:
all templates from the gem get the wrong compiler info:
when I change the template the file is regenerated, but the wrong compilerInfo sticks around!
I'm thankful for all suggestions :)
cheers, Raphael