Flow-router SSR for 1.4.2!

Hello !

I have a small web agency and we use Meteor and Flow-Router-SSR for our websites, but after the 1.4.2 update as many people have noticed Fast-Render (and so also flow-router-SSR) stopped working because of the inject-data package that was not compatible with the new patch.

Obviously the community patched fast-render and inject-data and now it works again (thanks to staringatlights:inject-data and staringatlights:fast-render).

Some people made Flow-router (non-SSR) forks for the new version but I didn’t find a Flow-router-SSR fork that was a drop-in replacement ! I found this repo : https://github.com/bensventures/flow-router and it works but you have to also replace dochead and go mess with react-mounter dist’s folder files everytime (and it is annoying because you have to do it everytime you reinstall/clone your repo that obviously doesn’t contain the node_modules folder).

I found in another repository that I can do this so that react-mounter and dochead think that kadira:flow-router-ssr is present : (in lib/_init.js file of flow-router-ssr)

// Export Router Instance
FlowRouter = new Router();
FlowRouter.Router = Router;
FlowRouter.Route = Route;

Package['kadira:flow-router-ssr'] = {FlowRouter}; // This line !

I’m not sure it is a good thing to do but and it would be cool if someone with better experience than me give his thoughts on this, because I kind of just assembled things that I do not really understand together, but it fixes the problem and allows this package to be a drop-in replacement for flow-router-ssr in 1.4.2 !

So you just have to replace kadira:flow-router-ssr by mighdy:flow-router-ssr and it fixes SSR in 1.4.2 !

But be aware it only works in Meteor 1.3.4+ and it will break if you try to install it on anterior versions !

I hope it will be helpful to someone !

Have a great day !

2 Likes

hi, i installed your package mighdy:flow-router-ssr but srr still not working…
i am on METEOR@1.4.3.2

Mh, I don’t know, I’m not using flow-router anymore… sorry, I won"t be maintaining this fork.

I’m sure you can find another fork that works on atmosphere :smiley:

Or, If you want, you can use react-router 4 with SSR : https://github.com/ssrwpo/ssr

1 Like