kadirahq / flow-router

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

[SSR] Issue with publish-counts package #569

Closed SachaG closed 8 years ago

SachaG commented 8 years ago

(Cross-posted from https://github.com/percolatestudio/publish-counts/issues/80)

Basically, calling Counts.publish() inside a publication seems to be preventing FlowRouter from subscribing to that publication when performing SSR. As a result the collection is empty inside the FlowRouter SSR simulation.

As soon as I comment out Counts.publish(), FlowRouter SSR finds the documents again.

tmeasday commented 8 years ago

It's not obvious to me why this would break FR, but I don't know exactly how it monkey patches publish..

SachaG commented 8 years ago

I figured it out: to prevent this from happening, make sure you call Counts.publish with the {noReady: true} option.