longshotlabs / meteor-template-extension

A Meteor package: Replace already defined templates, inherit helpers and events from other templates
https://atmospherejs.com/aldeed/template-extension
MIT License
220 stars 20 forks source link

Functions defined on Blaze.TemplateInstance.prototype are not set #23

Closed gabriel-dehan closed 9 years ago

gabriel-dehan commented 9 years ago

Hello, I have this weird bug where all methods defined in https://github.com/aldeed/meteor-template-extension/blob/master/template-extension.js on Blaze.TemplateInstance.prototype (parent() for instance) are not set after adding the package.

I do have the methods defined on Template and Template.prototype though.

I just copy-pastad the template-extension.js file in my project and everything works fine. It seems to be the fact that I am adding the package via meteor add that breaks this.

Any idea on why ?

aldeed commented 9 years ago

Strange. We're depending on blaze pkg, so Blaze.TemplateInstance should be stable by the time we're extending it. Unless another pkg is altering it improperly. Can you post your full package list?

gabriel-dehan commented 9 years ago

Thanks for the quick answer !

Yeah that was what I thought may cause the problem but I am not sure. Here is my package list

meteor-platform                                                                                                                                                                              
iron:router                                                                                                                                                                                  
dburles:collection-helpers                                                                                                                                                                   
matb33:collection-hooks                                                                                                                                                                      
reywood:publish-composite                                                                                                                                                                    
aldeed:autoform                                                                                                                                                                              
meteorhacks:subs-manager                                                                                                                                                                     
zimme:collection-softremovable                                                                                                                                                               
zimme:collection-timestampable                                                                                                                                                               
u2622:persistent-session                                                                                                                                                                     
anti:fake                                                                                                                                                                                    
dburles:factory                                                                                                                                                                              
ongoworks:security                                                                                                                                                                           
zimme:iron-router-auth                                                                                                                                                                       
zimme:iron-router-active                                                                                                                                                                     
accounts-base                                                                                                                                                                                
accounts-password                                                                                                                                                                            
aldeed:collection2                                                                                                                                                                           
browser-policy                                                                                                                                                                               
twbs:bootstrap                                                                                                                                                                               
fortawesome:fontawesome                                                                                                                                                                      
yogiben:admin                                                                                                                                                                                
mizzao:bootboxjs                                                                                                                                                                             
aldeed:console-me                                                                                                                                                                            
mrt:flash-messages                                                                                                                                                                           
wizonesolutions:underscore-string                                                                                                                                                            
lepozepo:s3
mitar commented 9 years ago

Can you make a small reproduction?

fusepilot commented 9 years ago

I'm trying the package out for the first time and just ran into this. Template.methods are there, but no instance.methods.

Here's a repro.

fusepilot commented 9 years ago

Ah, Atmosphere was pulling down v0.1.0. Had to specify v3.4.0 to get it working.

gabriel-dehan commented 9 years ago

@fusepilot : same issue, fixed the same way.

mbernath commented 9 years ago

Just had the same issue. Fixed the same way.