kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 194 forks source link

"Meteor code must always run within a Fiber." when using ssr #522

Closed kctang closed 8 years ago

kctang commented 8 years ago

I am trying to get a very simple app running based on Mantra. Got this error:

E20160206-19:47:20.502(8) (webapp_server.js:716) Error running template: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
  at Object.Meteor._nodeCodeMustBeInFiber (packages/meteor/dynamics_nodejs.js:9:1)
at [object Object]._.extend.get (packages/meteor/dynamics_nodejs.js:21:1)
at Object.Tracker.autorun (packages/kadira:flow-router-ssr/server/plugins/ssr_data.js:51:29)
at [object Object].Blaze.View.autorun (packages/blaze/view.js:209:1)
at [object Object].<anonymous> (packages/blaze/builtins.js:157:1)
at fireCallbacks (packages/blaze/view.js:279:1)
at Object.Tracker.nonreactive (packages/tracker/tracker.js:589:1)
at packages/blaze/view.js:276:1
at Object.Blaze._withCurrentView (packages/blaze/view.js:538:1)
at Object.Blaze._fireCallbacks (packages/blaze/view.js:275:1)

Replacing flow-router-ssr with flow-router solved the problem - i'm now able to get a very simple react component displayed on screen. However, the mantra sample blog seems to be using flow-router-ssr.

Is this an ssr bug? What's the right way of doing this? Also, any slack/gitter for mantra?

Running 1.3 beta8.

timothyarmes commented 8 years ago

Same problem here.

novium commented 8 years ago

This should be fixed in the next Meteor beta release Issue: https://github.com/meteor/meteor/issues/6170 PR: https://github.com/meteor/meteor/pull/6179 Try downgrading to 1.3-modules-beta.6 for now

arunoda commented 8 years ago

Is there a beta9 ?

onedr0p commented 8 years ago

Looks like this is fixed in Meteor Beta.11

novium commented 8 years ago

Can confirm that this is fixed in Meteor 1.3-beta.11 (and later)

arunoda commented 8 years ago

Yep. Here's a sample app too: https://github.com/kadira-samples/meteor-data-and-react