mantrajs / kickstart-mantrajs-webpack

Kickstart application with Mantrajs and meteor-webpack
45 stars 12 forks source link

FlowRouter SSR don't work properly #15

Closed ahmad-safar closed 8 years ago

ahmad-safar commented 8 years ago

I already implementing FlowRouter SSR. but have one problem. when defining FlowRouter.route inside function (injectDeps). SSR won't working, but after defining FlowRouter.route outside function (injectDeps) it will work.

ahmad-safar commented 8 years ago

Hey i got solution for this:

  1. import './client/main' in server.js, so all client stuff loads in server too.
  2. Only load methodStubs in client using Meteor.isClient
  3. Load all assets (if using webpack loader) inside Meteor.isClient block

SSR in MantraJS + Webpack is working now :)

ansonla3 commented 8 years ago

hi how can you make ssr works ? could you share the demo in github ? I didn't work as expected . it did not render the html elements. Thanks very much

ahmad-safar commented 8 years ago

hi @ansonla3 . Just follow my solution above and make sure you're import kadira:flow-router-ssr not kadira:flow-router