meteor-handlebars-server icon indicating copy to clipboard operation
meteor-handlebars-server copied to clipboard

Meteor upgrade to Release 0.8.0 ReferenceError: Handlebars is not defined

Open zhaoyou opened this issue 11 years ago • 11 comments

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: {},
  });

zhaoyou avatar Mar 31 '14 06:03 zhaoyou

+1

wbashir avatar Apr 01 '14 15:04 wbashir

@cmather +1

zhaoyou avatar Apr 02 '14 08:04 zhaoyou

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.

cmather avatar Apr 03 '14 17:04 cmather

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.

ericpedia avatar Apr 04 '14 21:04 ericpedia

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

wbashir avatar Apr 05 '14 22:04 wbashir

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 avatar Apr 08 '14 17:04 cmather

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

cmather avatar Apr 08 '14 17:04 cmather

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

cmather avatar Apr 08 '14 17:04 cmather

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

ericpedia avatar Apr 09 '14 01:04 ericpedia

Fine for me as well.

monbro avatar Apr 18 '14 19:04 monbro

[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

cassioscabral avatar May 23 '14 05:05 cassioscabral