Open chmac opened 8 years ago
The problem is that the collection's _transform()
is not applied during SSR. We found a workaround by adding something like this to our data component:
if (Meteor.isServer) {
doc = Collection._transform(doc)
}
It's a bit of a pain, and we need to do it manually in every component that fetches data, but it's less work than a massive refactor of helpers, etc.
Also posted the issue here dburles/meteor-collection-helpers#60.
Using
dburles:collection-helpers
and SSR, we find that the helpers are undefined during SSR.I tried to follow the SSR code and figure out what was going on, where the issue might lie, but didn't quite make it. I think that SSR (and it's dependency on FastRender) cause subscriptions and collections to be "wrapped" to add some magic, and those "wrapped" versions don't get the helpers added.
Is there a fix or a workaround? Or should we consider these two packages incompatible?