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

0.18 Uncaught Error: Unknown template object: function #110

Closed
attenzione opened this issue Sep 9, 2014 · 20 comments
Closed

0.18 Uncaught Error: Unknown template object: function #110

attenzione opened this issue Sep 9, 2014 · 20 comments

Comments

@attenzione
Copy link

Somewhere here:

function template(templateSpec, env) {
  /* istanbul ignore next */
  if (!env) {
    throw new Exception("No environment passed to template");
  }
  if (!templateSpec || !templateSpec.main) {
    throw new Exception('Unknown template object: ' + typeof templateSpec);
  }
  ...
@PikachuEXE
Copy link

I got the same error too

@dbkbali
Copy link

dbkbali commented Sep 10, 2014

Getting similar error if updating from 17.1

@AlexRiedler
Copy link
Collaborator

Thanks for the headsup guys, updated to handlebars 0.18 without having a rails installation handy and on the go. I will try to look into it in about 3 hours from now.

@AlexRiedler
Copy link
Collaborator

@dbkbali @PikachuEXE @attenzione is this due to rails caching ? I can not longer replicate after cleaning my rails tmp folder. (Handlebars output from compile is different format; and its not backwards compatible).

@attenzione
Copy link
Author

I will test it later, thanks for advise

Sent from Nexus 5
On Sep 12, 2014 11:00 PM, "Alex Riedler" notifications@github.com wrote:

@dbkbali https://github.com/dbkbali @PikachuEXE
https://github.com/PikachuEXE @attenzione
https://github.com/attenzione is this due to rails caching ? I can not
longer replicate after cleaning my rails tmp folder. (Handlebars output
from compile is different format; and its not backwards compatible).


Reply to this email directly or view it on GitHub
#110 (comment)
.

@PikachuEXE
Copy link

Clearing the cache in development and recompiling the assets on deploy does solve it

@attenzione
Copy link
Author

ok guys, clearing assets cache will resolve this problem, but i would recommend to add post comment when installing new gem version
this issue could be closed, but can be opened some time for other users

@AlexRiedler
Copy link
Collaborator

I am gonna think about it before closing; maybe there is some way I can notify that on a gem version change it should bump the cache version or something similar (cause this is an annoying issue for developing the plugin I have as well).

@attenzione
Copy link
Author

@AlexRiedler, you can add post message to gemspec, for example "after updating gem you should run rake assets:clobber to recompile all javascript"
https://github.com/jnunemaker/httparty/blob/e38baab559bb078ee421676b752d9877e5828b48/httparty.gemspec#L18

@tjgrathwell
Copy link
Contributor

Just asking the user to run rake assets:clobber isn't sufficient on Heroku, which seems to cache the old assets as well. It would be nice if there was a way for the gem to break the template cache somehow.

@ghost
Copy link

ghost commented Oct 4, 2014

Uncaught Error: Unknown template object: function
It doesn't go away after removing-precompiling assets, removing tmp and rake:assets:clobber

@AlexRiedler
Copy link
Collaborator

Does anyone know any better options? I will investigate some more when I have time.

@simeonwillbanks
Copy link

@tjgrathwell How'd you successfully deploy to Heroku? Thanks!

@simeonwillbanks
Copy link

heroku/heroku-buildpack-ruby#123 (comment) helped.

  1. Ensure running latest sprockets-rails
  2. $ heroku plugins:install https://github.com/heroku/heroku-repo.git
  3. $ heroku repo:purge_cache -a appname
  4. $ git push heroku master

@Breefield
Copy link

Still seeing this error on 0.18, clearing tmp didn't work.

@Breefield
Copy link

Nvm, clear tmp + touch restart.txt and there we go.

@deivinsontejeda
Copy link

I had the same issue with ember-rails once I deleted cache, everything works as expected. So I suggest you remove the cache on rm -rf tmp/*

@AlexRiedler
Copy link
Collaborator

okay so I found a way to fix this, and will be implemented in next release! (automatically cleans cache on update of the gem).

@Breefield
Copy link

Wonderful, thanks Alex!

On Mon, Jan 5, 2015 at 8:52 AM, Alex Riedler notifications@github.com
wrote:

okay so I found a way to fix this, and will be implemented in next
release! (automatically cleans cache on update of the gem).


Reply to this email directly or view it on GitHub
#110 (comment)
.

@ccmcbeck
Copy link

ccmcbeck commented Jan 6, 2015

Thanks, Alex! This is great news.

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

No branches or pull requests

9 participants