React-hot-loader: Uncaught SyntaxError: missing ) after argument list

Created on 1 Jun 2017  路  4Comments  路  Source: gaearon/react-hot-loader

Description

Bug in module.hot.accept: _Uncaught SyntaxError: missing ) after argument list ......... bundle.js:46413_

bundle.js

if (true) {
  module.hot.accept("./src/ProcessReissue/dev.jsx""./src/ProcessReissue/dev.jsx", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_3__dev__ = __webpack_require__("./src/ProcessReissue/dev.jsx"); (function(__WEBPACK_OUTDATED_DEPENDENCIES__) { /* harmony import */ __WEBPACK_IMPORTED_MODULE_3__dev__ = __webpack_require__("./src/ProcessReissue/dev.jsx"); (1)(__WEBPACK_OUTDATED_DEPENDENCIES__); })(__WEBPACK_OUTDATED_DEPENDENCIES__); }, function () {
    render(__WEBPACK_IMPORTED_MODULE_3__dev__["default"]);
  });
}

this "./src/ProcessReissue/dev.jsx""./src/ProcessReissue/dev.jsx" should be "./src/ProcessReissue/dev.jsx"

Expected behavior

What you think should happen: browser should show "Hello"

Actual behavior

What actually happens:

Environment

React Hot Loader version: [email protected]

Run these commands in the project folder and fill in their results:

  1. node -v: 7.1.0
  2. npm -v: 3.10.9

Then, specify:

  1. Operating system: Win7
  2. Browser and version: any

Reproducible Demo

src/ProcessReissue/hot.jsx

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import App from './dev';
const render = (Component) => {
  ReactDOM.render(
    <AppContainer>
      <Component />
    </AppContainer>,
    document.getElementById('application')
  );
};
render(App);
module.hot.accept('./dev', () => {
  render(App);
});

src/ProcessReissue/dev.jsx

import * as React from 'react';
const App = () => (
  <h2>Hello</h2>
);
export default App;

webpack.config.js

entry = [
  'react-hot-loader/patch',
  path.resolve(__dirname, 'src/ProcessReissue/hot.jsx')
];

Most helpful comment

I got the same error, cause i applied the HotModuleReplacementPlugin twice. 1. with --hot and 2. in plugins
Hope to help

All 4 comments

I got the same error, cause i applied the HotModuleReplacementPlugin twice. 1. with --hot and 2. in plugins
Hope to help

@yexingxia thank you, it helps!

@yexingxia thank you, it helps!!!

@yexingxia thanks !!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

mqklin picture mqklin  路  3Comments

mtscout6 picture mtscout6  路  3Comments

tiberiumaxim picture tiberiumaxim  路  4Comments

theKashey picture theKashey  路  3Comments