ayal / headly

meteor package to handle facebookexternalhit responses (for og:metatags use)
28 stars 7 forks source link

Fiber not defined #5

Closed NgKhanh closed 11 years ago

NgKhanh commented 11 years ago

Hi, I use headly with Meteor 6.4 by add file headly_server.js to server folder (I dont user meteorite) and config same your sample code. But it dont work. Please help !

ReferenceError: Fiber is not defined at Object.handle (app/server/headly_server.js:18:3) at next (C:\Program Files (x86)\Meteor\lib\node_modules\connect\lib\proto.js :190:15) at Object.Oauth._middleware (app/packages/oauth/oauth_server.js:80:7) at app/packages/oauth/oauth_server.js:68:13

ayal commented 11 years ago

oh man sorry, meteor changed it so you explicitly need to require fibers with Npm.require('fibers'). anyways, it should work now, you can pull the package again or re-install or whathaveyou.

NgKhanh commented 11 years ago

Very thanks @ayal But unfortunately for me, i dont know why it still has issue

TypeError: Object # has no method 'require' at Object.Meteor.headly.config.tagsForRequest (app/server/server.js:2:33) at app/packages/headly/headly_server.js:27:41

ayal commented 11 years ago

That's weird it seems to me the error is thrown from your code. You provide the tagsForRequest callback, and it seems to be thrown from there.

Can you paste the code you use to call "Meteor.headly.config" ?

and/or try to run the example app at: https://github.com/ayal/headly/tree/master/example to see if the problem occurs there too..

NgKhanh commented 11 years ago

Here my code https://github.com/khacthanh/fav.vn/blob/master/server/server.js

And same issue with your example. Now I think this error from my Meteor config, maybe I miss some package

ayal commented 11 years ago

no, the specific error you refer to is from your code when using

 __meteor_bootstrap__.require('url');

which is probably deprecated. You should use something like Npm.require('url'), but consult the Meteor documentation before you do that.

beforehand, try to just return a string from the callback function and see if it works, then work your way up from there:

Meteor.headly.config({tagsForRequest: function(req) {
return '<meta property="og:title" content="FAV.VN - nghe nhac va chat
realtime" />';
}});
NgKhanh commented 11 years ago

Oh, it works. I'm exciting to continue this code now

thanks for your help @ayal