{"action":"created","issue":{"url":"https://api.github.com/repos/markdalgleish/redial/issues/18","repository_url":"https://api.github.com/repos/markdalgleish/redial","labels_url":"https://api.github.com/repos/markdalgleish/redial/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/markdalgleish/redial/issues/18/comments","events_url":"https://api.github.com/repos/markdalgleish/redial/issues/18/events","html_url":"https://github.com/markdalgleish/redial/issues/18","id":134166924,"number":18,"title":"Lazy routes + split reducers?","user":{"login":"jaredpalmer","id":4060187,"avatar_url":"https://avatars.githubusercontent.com/u/4060187?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpalmer","html_url":"https://github.com/jaredpalmer","followers_url":"https://api.github.com/users/jaredpalmer/followers","following_url":"https://api.github.com/users/jaredpalmer/following{/other_user}","gists_url":"https://api.github.com/users/jaredpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpalmer/subscriptions","organizations_url":"https://api.github.com/users/jaredpalmer/orgs","repos_url":"https://api.github.com/users/jaredpalmer/repos","events_url":"https://api.github.com/users/jaredpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpalmer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T03:26:19Z","updated_at":"2016-02-19T22:38:34Z","closed_at":"2016-02-19T22:38:34Z","body":"I'm using @gaearon 's approach to [splitting out reducers](https://gist.github.com/gaearon/0a2213881b5d53973514) with @ryanflorence 's [lazy routes](https://github.com/ryanflorence/example-react-router-server-rendering-lazy-routes). Is it still possible to use redial? If so, how would you modify the fetching/trigger logic?\r\n\r\n```javascript\r\n// routes/index.js\r\n// Root Route\r\nimport PostList from './PostList';\r\nimport App from './App';\r\n\r\nexport default function createRoutes(store) {\r\n  const root = {\r\n    path: '/',\r\n    component: App,\r\n    getChildRoutes(location, cb) {\r\n      require.ensure([], (require) => {\r\n        cb(null, [\r\n          require('./Editor').default,\r\n          require('./Post').default(store),\r\n        ]);\r\n      });\r\n    },\r\n\r\n    indexRoute: {\r\n      component: PostList,\r\n    },\r\n  };\r\n\r\n  return root;\r\n}\r\n```\r\n\r\n``` javascript\r\n// routes/Post/index.js\r\n// Lazy Route\r\nimport { injectAsyncReducer } from '../../store';\r\n\r\nexport default function createRoutes(store) {\r\n  return {\r\n    path: 'post/:slug',\r\n    getComponents(location, cb) {\r\n      require.ensure([\r\n          './containers/PostPage',\r\n          './reducer',\r\n        ], (require) => {\r\n          let PostPage = require('./containers/PostPage').default;\r\n          let postReducer = require('./reducer').default;\r\n          injectAsyncReducer(store, 'currentPost', postReducer);\r\n          cb(null, PostPage);\r\n        });\r\n    },\r\n  };\r\n}\r\n\r\n```\r\n\r\n```javascript\r\n// server.js\r\nconst redial = (path) => new Promise((resolve, reject) => {\r\n  const store = configureStore();\r\n  const routes = createRoutes(store);\r\n  const { dispatch, getState } = store;\r\n  const history = useQueries(createMemoryHistory)();\r\n  const location = history.createLocation(path);\r\n\r\n  match({ routes, location }, (routerError, redirectLocation, renderProps) => {\r\n    const components = renderProps.routes.map(route => route.component);\r\n    const locals = {\r\n      path: renderProps.location.pathname,\r\n      query: renderProps.location.query,\r\n      params: renderProps.params,\r\n      dispatch,\r\n    };\r\n    trigger('fetch', components, locals)\r\n      .then(() => {\r\n        const data = getState();\r\n        const html = renderToString(\r\n          <Provider store={store}>\r\n            <RoutingContext {...renderProps} />\r\n          </Provider>\r\n        );\r\n        resolve({ data, html});\r\n      })\r\n      .catch(e => reject(e));\r\n  });\r\n});\r\n````\r\nThis is the error in the console:\r\n```bash\r\n[Error: Cannot automatically buffer without a document]\r\n```"},"comment":{"url":"https://api.github.com/repos/markdalgleish/redial/issues/comments/186436940","html_url":"https://github.com/markdalgleish/redial/issues/18#issuecomment-186436940","issue_url":"https://api.github.com/repos/markdalgleish/redial/issues/18","id":186436940,"user":{"login":"jaredpalmer","id":4060187,"avatar_url":"https://avatars.githubusercontent.com/u/4060187?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpalmer","html_url":"https://github.com/jaredpalmer","followers_url":"https://api.github.com/users/jaredpalmer/followers","following_url":"https://api.github.com/users/jaredpalmer/following{/other_user}","gists_url":"https://api.github.com/users/jaredpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpalmer/subscriptions","organizations_url":"https://api.github.com/users/jaredpalmer/orgs","repos_url":"https://api.github.com/users/jaredpalmer/repos","events_url":"https://api.github.com/users/jaredpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpalmer/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T22:38:33Z","updated_at":"2016-02-19T22:38:33Z","body":"Fixed."}}