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

PRE4: bodyParser causes: "Can't wait without a fiber #914

Closed
boustanihani opened this issue Oct 13, 2014 · 1 comment
Closed

PRE4: bodyParser causes: "Can't wait without a fiber #914

boustanihani opened this issue Oct 13, 2014 · 1 comment

Comments

@boustanihani
Copy link

I am using iron:router@=1.0.0-pre4

As suggested in previous posts, in the mean time we should add Router.use(Router.bodyParser()) until the old behaviour of iron-router is back.

But this is causing the Error: Can't wait without a fiber when there is a database operation inside the route. For reproduction use http://www.getpostman.com/ for posting some JSON and use this repository: https://github.com/boustanihani/iron-router-pre4-bodyParser as a server.

  Router.use(Router.bodyParser()); // If commented everything works fine but no 'body'

  Router.route('/pi', {
    where: 'server'
  }).post(function() {

    if (this.request.body) {
      console.log('body: ' + JSON.stringify(this.request.body, null, 4));
    }

    var result = NUMBERS.findOne({
      name: 'PI'
    });

    this.response.writeHead(200, {
      'Content-Type': 'text/html'
    });
    this.response.end('PI = ' + result.value);

  });
Error: Can't wait without a fiber
    at Function.wait (/home/hani/.meteor/packages/meteor-tool/.1.0.33.q7phxd++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:83:9)
    at Object.Future.wait (/home/hani/.meteor/packages/meteor-tool/.1.0.33.q7phxd++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:325:10)
    at _.extend._nextObject (packages/mongo/mongo_driver.js:858)
    at _.extend.forEach (packages/mongo/mongo_driver.js:892)
    at _.extend.map (packages/mongo/mongo_driver.js:902)
    at _.extend.fetch (packages/mongo/mongo_driver.js:926)
    at Cursor.(anonymous function) [as fetch] (packages/mongo/mongo_driver.js:741)
    at MongoConnection.findOne (packages/mongo/mongo_driver.js:647)
    at _.extend.findOne (packages/mongo/coll
@boustanihani
Copy link
Author

Deplicate by mistake: #915

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

1 participant