Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Cannot apply update. Need to do a full reload! #342

Closed
code-artisan opened this issue Dec 11, 2015 · 5 comments
Closed

Warning: Cannot apply update. Need to do a full reload! #342

code-artisan opened this issue Dec 11, 2015 · 5 comments

Comments

@code-artisan
Copy link

image

webpack.config.js

var path = require("path");
var webpack = require('webpack');

module.exports = {
  entry: {
    app: [
      'webpack-dev-server/client?http://0.0.0.0:4000', // WebpackDevServer host and port
      'webpack/hot/dev-server', // "only" prevents reload on syntax errors
      "./app/main.jsx",
      "./app/main.js"
    ]
  },
  output: {
    path: path.join(__dirname, "dist", "javascript"),
    publicPath: "/dist/javascript/",
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {
        test: /\.(jsx|es6)$/,
        loaders: ['react-hot', 'babel-loader'],
        include: path.join(__dirname, 'app')
      }
    ]
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin()
  ]
};

server.js

var path = require('path');
var webpack = require('webpack');
var config = require("./webpack.config.js");
var compiler = webpack(config);
var WebpackDevServer = require('webpack-dev-server');

config.entry.app.unshift("webpack-dev-server/client?http://localhost:4000", "webpack/hot/dev-server");
var server = new WebpackDevServer(compiler, {
  contentBase: './',
  hot: true,
  inline: true,
  stats: {
    color: true
  },
  publicPath: config.output.publicPath
});

server.listen(4000, 'localhost', function (error) {
  if (error) {
    console.log(error);
  }
  console.log('Server running at localhost:4000');
});
@iroy2000
Copy link

iroy2000 commented Feb 1, 2016

I have a similar issue here #395

@SpaceK33z
Copy link
Member

Closing due to staleness, see #395 for more info about this kind of issue.

@Praveen-Invoscape
Copy link

How to solve it.....anyone give information about that??

@SpaceK33z
Copy link
Member

As said above, see #395.

@Praveen-Invoscape
Copy link

I am new to reactjs, so i am not have clear understanding to how to use the module.hot.accept()...Plz give some details about module.hot.accept().Thank you for ur reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants