Closed ghost closed 8 years ago
If anything inside render() throws, server will not respond to client making them wait infinitely. Example:
import IsomorphicRouter from 'isomorphic-relay-router'; app.get('/*', (req, res, next) => { match({routes, location: req.originalUrl}, (error, redirectLocation, renderProps) => { if (error) { next(error); } else if (redirectLocation) { res.redirect(302, redirectLocation.pathname + redirectLocation.search); } else if (renderProps) { IsomorphicRouter.prepareData(renderProps, networkLayer).then(render, next); } else { res.status(404).send('Not Found'); } function render({data, props}) { throw new Error("Something failed"); } }); });
Encountered this problem while trying to convert a react-relay component to isomorphic-relay-router.
See here: https://github.com/denvned/isomorphic-relay-router/issues/38#issuecomment-228018924 Sorry, I forgot to push the fix the first time it was reported, but did it now.
If anything inside render() throws, server will not respond to client making them wait infinitely. Example:
Encountered this problem while trying to convert a react-relay component to isomorphic-relay-router.