-
Notifications
You must be signed in to change notification settings - Fork 159
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
partials not found exception in Handlebars.js #35
Comments
Hi @twyfordr, You should be accessing it as '_goal_steps' (see the discussion in the README https://github.com/leshill/handlebars_assets#partials). One thing to note is that you can see the partials that have been registered with Handlebars. In the JS console, take a look at:
That should have the partial in it. |
I should have mentioned that I was using the JS console when troubleshooting - Handlebars.partials is empty. I do see my templates under the JST object. No partials. |
Hi @twyfordr, How are you including your templates on the page? Is the template being included into From the web inspector (using Chrome/Safari or Firebug in FF) you should see the template in your JS source for the page. |
My partials work in versions 0.4.4, 0.6.6, and 0.6.7, but when I upgrade to 0.7.1 I get the error Not sure what happened to cause the error. |
I spoke too soon. I now have the same problem in prod. It works fine in dev and staging now, but I get the unknown partial error |
Hi Peter, Interesting, please check the results of looking at |
I had to rollback production. Result from staging, running the same code as production was:
This is interesting. It means that the pages I have been so far able to access on staging hadn't been using handlebars, which is why I assumed staging was working. I think it was working in dev on new handlebars, with old partial syntax, but maybe that was an artifact of something else. I now think the issue is that I upgraded and didn't know to upgrade how partials were referenced. I am doing that now. |
Hi @pboling, Are the rest of the files regular templates? Or just misnamed partials? |
@leshill It is very strange. I do have a partial that has the same name as a template. Here is the full list of my templates dir:
|
@leshill Now if I grep that for just the partials, and compare it to my list, I am left scratching my head::
|
Hi @pboling, Have you just changed the On your dev environment, you should run |
@leshill
|
After changing all my partials with the tag as above, re-running |
Hi @pboling, Just to be clear, running |
Full disclosure: I am brand new to handlebars, coming into a project that makes extensive use of it with Backbone.js for the views. It uses the asset pipeline, and is on latest rails and Ruby. And, yes I have also recently run |
WOW. You are a bad ass @leshill. Thanks for fixing me. :) |
Hi @pboling, No worries, this has cropped up before and nailing down what is happening and what to do to get it right is useful (and going into the Good luck! |
I've tried several different things, but can't get my partial to be recognized by Handlebars. I'm using handlebars_assets 0.6.6 and rails 3.2.3 (although I've also tried against 3.2.8). My templates are working, just not partials. My partial is in a subdirectory named goals and is named _steps.jst.hbs. I'm trying to access it as goal_steps.
I'm getting an exception in invokePartial() of Handlebars.js that the partial can't be found. The partials array is empty.
I am using the JST namespace. I set a breakpoint in tilt_handlebars after reading another issue, and I see the call to register_partial with the correct partial name.
What else should I try?
The text was updated successfully, but these errors were encountered: