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

Custom Publish/Subscribe with Flow Router SSR #454

Closed
maddijoyce opened this issue Dec 18, 2015 · 5 comments
Closed

Custom Publish/Subscribe with Flow Router SSR #454

maddijoyce opened this issue Dec 18, 2015 · 5 comments

Comments

@maddijoyce
Copy link

Hi,
I think I might have a similar issue to #431.

My publish basically looks like:

Meteor.publish("data", function(query) {
  ExternalService.find(query, (err, result) => {
    this.added("data", result.id, result);
    this.ready();
  });
});

And then in my React class I use:

getMeteorData() {
  var dataLoaded = Meteor.subscribe("data", { name: name });
  var data = Data.findOne({ name: name });

  return {
    user: Meteor.user(),
    dataLoaded: dataLoaded.ready(),
    data: data
  };
}

However, when performing an initial render on the server, I get this error:

Publish handler for { name: 'data', params: [ { name: 'Test' } ] } sent no ready signal

I double checked, and I'm on version 3.7.3 of flow-router-ssr, but the issue is still occurring.

Thanks,
Maddi

@rozzzly
Copy link

rozzzly commented Dec 18, 2015

Put a console.log in your arrow function. Does it fire before, or after error? Or not at all

@maddijoyce
Copy link
Author

It's firing after the error.

@maddijoyce
Copy link
Author

So, it looks like I wasn't quite looking in the right place:
I've found the error message- https://github.com/kadirahq/fast-render/blob/master/lib/server/context.js#L105

So apparently, my external service is taking more than 500ms. I guess I'll need to configure that value?

@arunoda
Copy link
Contributor

arunoda commented Dec 18, 2015

But if it takes more the 500ms, you should not use that publication in SSR.
Do it after page loads.
On 2015 දෙසැ 18, සිකු at පෙ.ව. 7.13 Maddi Joyce [email protected]
wrote:

So, it looks like I wasn't quite looking in the right place:
I've found the error message-
https://github.com/kadirahq/fast-render/blob/master/lib/server/context.js#L105

So apparently, my external service is taking more than 500ms. I guess I'll
need to configure that value?


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

@maddijoyce
Copy link
Author

Ok, that makes sense.
Thanks for your help.

Cheers,
Maddi

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

3 participants