webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server
MIT License
2.34k stars 297 forks source link

Ignored an update to unaccepted module #293

Open john1jan opened 6 years ago

john1jan commented 6 years ago

I am getting this error

screen shot 2018-03-26 at 8 36 56 pm

This is my routes.js

import React from 'react';
import { Route, IndexRoute } from 'react-router';
import NotFoundPage from './components/NotFound/NotFound';
import Wrapper from './views/Wrapper/Wrapper';
import importCss from './utils/importCss';
import LandingPage from './views/LandingPage/LandingPage'
export default (
  <Route path="/" component={Wrapper}>
    <IndexRoute
      name="LandingPage"
      component={LandingPage}
    />

    <Route path="*" component={NotFoundPage} />

  </Route>
);

webpack: 3.6.0 webpack-dev-middleware: 1.10.2 webpack-hot-middleware: 2.21.2

lampshaj commented 5 years ago

What was your solution

I am getting this error

screen shot 2018-03-26 at 8 36 56 pm

This is my routes.js

import React from 'react';
import { Route, IndexRoute } from 'react-router';
import NotFoundPage from './components/NotFound/NotFound';
import Wrapper from './views/Wrapper/Wrapper';
import importCss from './utils/importCss';
import LandingPage from './views/LandingPage/LandingPage'
export default (
  <Route path="/" component={Wrapper}>
    <IndexRoute
      name="LandingPage"
      component={LandingPage}
    />

    <Route path="*" component={NotFoundPage} />

  </Route>
);

webpack: 3.6.0 webpack-dev-middleware: 1.10.2 webpack-hot-middleware: 2.21.2

What was your solution?

ozyman42 commented 4 years ago

I added this to the bottom of my entry file

module.hot.accept((err) => {
    console.log("reloading self");
    window.location.reload();
})
patosai commented 3 years ago

I was using ES6 modules and after a lot of searching found that module.hot was called import.meta.webpackHot. So I added this to my entry file and I didn't get the error anymore.

if (import.meta.webpackHot) {
  import.meta.webpackHot.accept();
}