React HMR failing: modules[moduleId].call is not a function
<p>In React/Redux application, using Webpack I am getting this TypeError when trying to do a hot reload (first time works, but I get an error displayed bellow and afterwards stops working). </p>

<p>The app is build on this starter kit: <a href="https://github.com/davezuko/react-redux-starter-kit/tree/v1.0.1" rel="nofollow">https://github.com/davezuko/react-redux-starter-kit/tree/v1.0.1</a>, but I guess that some update of the library broke something.</p>

<p>Error:</p>

<pre><code>React Transform HMR] There was an error updating /www/src/containers/Root.js
index.js:60 TypeError: modules[moduleId].call is not a function(…)
</code></pre>

<p>Totally stripped version of app bellow, but still error in HRM.</p>

<p>Root file (that is this: <a href="https://github.com/davezuko/react-redux-starter-kit/blob/v1.0.1/src/containers/Root.js" rel="nofollow">https://github.com/davezuko/react-redux-starter-kit/blob/v1.0.1/src/containers/Root.js</a>) receives routes like this: </p>

<pre><code>import React from 'react';
import { Route, IndexRoute, Redirect } from 'react-router';

import WelcomeLayout from 'layouts/WelcomeLayout/WelcomeLayout';
import NotFoundView from 'views/NotFoundView/NotFoundView';

export default (
    &lt;Route&gt;
        &lt;Route component={WelcomeLayout} path='/'&gt;
            &lt;IndexRoute component={NotFoundView} /&gt;
        &lt;/Route&gt;
        &lt;Redirect from='*' to='/'/&gt;
    &lt;/Route&gt;
);
</code></pre>

<p>NotFoundView:</p>

<pre><code>import React from 'react';
import { Link } from 'react-router';

export class NotFoundView extends React.Component {
    render () {
        return (
            &lt;div&gt;
                &lt;h1&gt;Page not found - 404!&lt;/h1&gt;
                &lt;hr /&gt;
                &lt;Link to='/'&gt;Back&lt;/Link&gt;
            &lt;/div&gt;
        );
    }
}

export default NotFoundView;
</code></pre>

<p>package.json:</p>

<pre><code>{
  "name": "App",
  "version": "0.0.1",
  "description": "myApp",
  "private": true,
  "main": "index.js",
  "engines": {
    "node": "&gt;=4.2.0",
    "npm": "^3.0.0"
  },
  "scripts": {
    "clean": "rm -rf dist",
    "compile": "node -r dotenv/config --harmony bin/compile",
    "lint": "eslint . ./",
    "lint:fix": "npm run lint -- --fix",
    "start": "better-npm-run start",
    "dev": "better-npm-run dev",
    "dev:nw": "npm run dev -- --nw",
    "dev:no-debug": "npm run dev -- --no_debug",
    "test": "better-npm-run test",
    "test:dev": "npm run test -- --watch",
    "deploy": "better-npm-run deploy"
  },
  "betterScripts": {
    "dev": {
      "command": "nodemon -r dotenv/config bin/server",
      "env": {
        "NODE_ENV": "development"
      }
    },
    "deploy": {
      "command": "npm run clean &amp;&amp; npm run compile",
      "env": {
        "NODE_ENV": "production"
      }
    },
    "start": {
      "command": "node -r dotenv/config bin/server"
    },
    "test": {
      "command": "node -r dotenv/config ./node_modules/karma/bin/karma start bin/karma.js",
      "env": {
        "NODE_ENV": "test"
      }
    }
  },
  "dependencies": {
    "better-npm-run": "0.0.5",
    "debug": "^2.2.0",
    "dotenv": "^1.2.0",
    "es6-promise": "^3.0.2",
    "history": "^2.0.0-rc2",
    "isomorphic-fetch": "^2.2.1",
    "koa": "^2.0.0-alpha.3",
    "koa-connect-history-api-fallback": "^0.3.0",
    "koa-convert": "^1.2.0",
    "koa-static": "^2.0.0",
    "react": "^0.14.0",
    "react-bootstrap": "^0.28.2",
    "react-dom": "^0.14.0",
    "react-redux": "^4.0.0",
    "react-router": "^2.0.0-rc5",
    "redux": "^3.0.0",
    "redux-actions": "^0.9.0",
    "redux-simple-router": "^2.0.2",
    "redux-thunk": "^1.0.0",
    "url": "^0.11.0",
    "yargs": "^3.18.0"
  },
  "devDependencies": {
    "babel-core": "^6.3.17",
    "babel-eslint": "^5.0.0-beta6",
    "babel-loader": "^6.2.0",
    "babel-plugin-add-module-exports": "^0.1.1",
    "babel-plugin-transform-runtime": "^6.3.13",
    "babel-preset-es2015": "^6.3.13",
    "babel-preset-react": "^6.3.13",
    "babel-preset-react-hmre": "^1.0.0",
    "babel-preset-stage-0": "^6.3.13",
    "babel-register": "^6.3.13",
    "babel-runtime": "^6.3.19",
    "chai": "^3.4.1",
    "chai-as-promised": "^5.1.0",
    "css-loader": "^0.23.0",
    "cssnano": "^3.3.2",
    "eslint": "^1.10.3",
    "eslint-config-standard": "^4.4.0",
    "eslint-config-standard-react": "^1.2.1",
    "eslint-loader": "^1.1.1",
    "eslint-plugin-babel": "^3.0.0",
    "eslint-plugin-react": "^3.14.0",
    "eslint-plugin-standard": "^1.3.1",
    "extract-text-webpack-plugin": "^1.0.0",
    "fetch-mock": "^4.0.1",
    "fetch-mock-forwarder": "^1.0.0",
    "file-loader": "^0.8.4",
    "fs-extra": "^0.26.3",
    "html-webpack-plugin": "^1.6.1",
    "isparta-loader": "^2.0.0",
    "json-loader": "^0.5.4",
    "karma": "^0.13.8",
    "karma-chai": "^0.1.0",
    "karma-chai-as-promised": "^0.1.2",
    "karma-chai-sinon": "^0.1.5",
    "karma-coverage": "^0.5.0",
    "karma-mocha": "^0.2.0",
    "karma-phantomjs-launcher": "^0.2.1",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-spec-reporter": "0.0.23",
    "karma-webpack": "^1.7.0",
    "mocha": "^2.2.5",
    "node-sass": "^3.3.3",
    "nodemon": "^1.8.1",
    "phantomjs-prebuilt": "^2.1.3",
    "phantomjs-polyfill": "0.0.1",
    "postcss-loader": "^0.8.0",
    "react-addons-test-utils": "^0.14.0",
    "react-shallow-testutils": "^0.7.1",
    "redux-devtools": "^3.0.0",
    "redux-devtools-dock-monitor": "^1.0.1",
    "redux-devtools-log-monitor": "^1.0.1",
    "redux-mock-store": "0.0.6",
    "sass-loader": "^3.0.0",
    "sinon": "^1.17.2",
    "sinon-chai": "^2.8.0",
    "style-loader": "^0.13.0",
    "url-loader": "^0.5.6",
    "webpack": "1.12.9",
    "webpack-dev-middleware": "^1.4.0",
    "webpack-hot-middleware": "^2.6.0"
  }
}
</code></pre>

<p>Any ideas what could cause this?</p>