<commit_before>import React from 'react';
import { renderToString } from 'react-dom/server';
import { StaticRouter } from 'react-router-dom';
import { createStore } from 'redux'
import getMuiTheme from 'material-ui/styles/getMuiTheme'

import getStore from './store'
import Main from '../client/components/Main';

const assets = require(process.env.RAZZLE_ASSETS_MANIFEST);

export default () => {
  return (...args) => {
    return serverSideRender(...args).catch(e => {
      if (!res.headersSent) res.status(500)
      res.send('Server error')
      console.error('[500]', e)<commit_msg>Fix ReferenceError: res is not defined<commit_after>import React from 'react';
import { renderToString } from 'react-dom/server';
import { StaticRouter } from 'react-router-dom';
import { createStore } from 'redux'
import getMuiTheme from 'material-ui/styles/getMuiTheme'

import getStore from './store'
import Main from '../client/components/Main';

const assets = require(process.env.RAZZLE_ASSETS_MANIFEST);

export default () => {
  return (req, res, next) => {
    return serverSideRender(req, res, next).catch(e => {
      if (!res.headersSent) res.status(500)
      res.send('Server error')
      console.error('[500]', e)
{'fraction_non_alphanumeric': 0.1468416735028712, 'fraction_numerical': 0.009844134536505332, 'mean_word_length': 4.398230088495575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5878697', 'n_tokens_mistral': 388, 'n_tokens_neox': 374, 'n_words': 96}