Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Meteor code must always run within a Fiber #3

Open
elie222 opened this issue Feb 16, 2015 · 6 comments
Open

Error: Meteor code must always run within a Fiber #3

elie222 opened this issue Feb 16, 2015 · 6 comments

Comments

@elie222
Copy link

elie222 commented Feb 16, 2015

My mup logs:

spiderable: phantomjs failed: null
stderr:
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 Object].RouteController.lookupOption (packages/iron:router/lib/route_controller.js:66:1)
at new Controller.extend.constructor (packages/iron:router/lib/route_controller.js:26:1)
at [object Object].ctor (packages/iron:core/lib/iron_core.js:88:1)
at Function.Router.createController (packages/iron:router/lib/router.js:201:1)
at Function.Router.dispatch (packages/iron:router/lib/router_server.js:39:1)
at Object.router (packages/iron:router/lib/router.js:15:1)
at next (/opt/draftapp/app/programs/server/npm/webapp/node_modules/connect/lib/proto.js:190:15)
at processNextSubRouter (packages/meteorhacks:picker/lib/implementation.js:74:1)

@arunoda
Copy link
Member

arunoda commented Feb 16, 2015

This doesn't seems like a picker's error. It's passing the http request to IR and that's where the error throws. But, I'ld like to see a sample code or something which can be re-producible.

@elie222
Copy link
Author

elie222 commented Feb 16, 2015

I don't actually know where it's coming from. I don't use the picker
package. Some other package must be using it and causing the error.

On 17 February 2015 at 00:22, Arunoda Susiripala [email protected]
wrote:

This doesn't seems like a picker's error. It's passing the http request to
IR and that's where the error throws. But, I'ld like to see a sample code
or something which can be re-producible.


Reply to this email directly or view it on GitHub
#3 (comment).

@arunoda
Copy link
Member

arunoda commented Feb 16, 2015

Actually, it can be fast-render. If that's the case, try to isolate the publication which cause this and send me. Still, I'm not exactly sure where this is happening.

@franxois
Copy link

Hi,
I have this error with this code

Picker.route('/frames', function(params, req, res, next) {
    if (req.method == "POST") {
      req.on("data", function(data) {
            var data = JSON.parse(data);
                    mongo_trames.update({

 }, {
                         $push: {
                             data: [trame.ts, trame.nb]
                         }
                     }, {
                         upsert: true
                     });
                }
            }
        });
    }
    res.end();
});

The error appears when I add the mongo.update() part
That may not be related directly to Fiber but how do we have to deal with the "req.on("data",callback)" think the meteor way ?? I try Meteor.wrapAsync without success :(

@zimt28
Copy link

zimt28 commented Sep 10, 2015

What about Meteor.bindEnvironment?

@gustawdaniel
Copy link

I too have problem with this error when I trying to use mongo handling requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants