cmather / meteor-handlebars-server

Server side handlebars support for Meteor
80 stars 14 forks source link

Meteor upgrade to Release 0.8.0 ReferenceError: Handlebars is not defined #14

Open zhaoyou opened 10 years ago

zhaoyou commented 10 years ago

rt. Handlebars namespace deprecated in v0.8.0

https://github.com/meteor/meteor/wiki/Using-Blaze#handlebars-namespace-deprecated

I see handlebars_server.js 。 use OriginalHandlebars or Spacebars instead of Handlebars ?

  OriginalHandlebars = Npm.require('handlebars');

  _.extend(Handlebars, {
     templates: {},
  });
wbashir commented 10 years ago

+1

zhaoyou commented 10 years ago

@cmather +1

cmather commented 10 years ago

I'm in the process of upgrading EM so I'll fix this as part of that effort. If anyone wants to take a stab at it first that would be great.

ericpedia commented 10 years ago

In the meantime as a footnote for users who stumble across this, you can run meteor update --release 0.7.2 to go back to a compatible version.

wbashir commented 10 years ago

@ryw Have you updated yet, wondering if you are still using this package.

cmather commented 10 years ago

I'm looking at this now. Is this actually breaking for you? Handlebars should still be defined I think. And we're not seeing any errors.

cmather commented 10 years ago

Oh we just spotted this. Just upgrade your package and it should work. We actually fixed this a while ago.

cmather commented 10 years ago

Just do mrt update and let me know if that fixes this issue.

ericpedia commented 10 years ago

That fixed it for me. Now working fine with Meteor 0.8.0.

monbro commented 10 years ago

Fine for me as well.

cassioscabral commented 10 years ago

[link to code below] For me is not working on production. Can't figure it out why.

I did some tests though:

Handlebars.templates is undefined in production.

Trying to log Handlebars.templates before my Meteor.call(...) I got undefined. Probably because I'm doing this outside the server folder ?

Although inside(still outside of server folder) a Meteor.call function I call Handlebars.templates['my-template'] and works(in development) fine and I receive an email and everything goes right.

It is possibly that the minified version on production is making that this doesn't work ?

I'm using Meteor 0.8.0.1

http://pastebin.com/KmiWcK2q

Anyone can help me with that ? really appreciate it