Git Product home page Git Product logo

Comments (15)

stevenbirr avatar stevenbirr commented on June 1, 2024 3

Maybe this could help you: I had the same issue. At work it worked like a charm, at home sometimes yes, sometimes no. Thus, it had to be any timing issue. I played around with some WebpackDevServer options. Try this:

...
new WebpackDevServer(webpack(config), {
  watchOptions: {
    aggregateTimeout: 300,
    poll: 300
  },
})
...

Now, webpack hot reloading works for me.
Tried it with node 4.2.2, npm 3.5.0, webpack 1.12.9, webpack-dev-server 1.14.0

from react-hot-boilerplate.

stevenbirr avatar stevenbirr commented on June 1, 2024 3

I think, I found the solution for the problem. I found the clue here: https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write
You should have a look at your IDE, in my case PHPStorm, and disable the safe mode. After that, hot reloading works like a charm, even without

hot: true,
watchOptions: {
  aggregateTimeout: 300,
  poll: 300
}

from react-hot-boilerplate.

Prophet32j avatar Prophet32j commented on June 1, 2024 1

hi guys. Not sure if you guys are still experiencing this problem. The solution that works for me was to remove "hot: true" from the server.js.

The reason for this is you are already using webpack.HotModuleReplacementPlugin along with the React Hot Loader module. Dan gives a specific note within his wiki to not call out --hot. --hot is the same as hot: true for Inline Dev Server.

See: http://gaearon.github.io/react-hot-loader/getstarted/
Also: https://webpack.github.io/docs/webpack-dev-server.html#inline-mode-with-node-js-api

from react-hot-boilerplate.

ColeTownsend avatar ColeTownsend commented on June 1, 2024

Having the same problem @cryptolemming

from react-hot-boilerplate.

stevenbirr avatar stevenbirr commented on June 1, 2024

Did not work for me at first. After installing Node 4 and the latest versions of node-gyp and npm hot module reloading works. Maybe my comment in this thread helps others: nodejs/node-gyp#629 (comment)

from react-hot-boilerplate.

MaronMariusz avatar MaronMariusz commented on June 1, 2024

Hi, for me it does not work as well, even if I have installed Node 4. Can't reload content at all.

from react-hot-boilerplate.

stevenbirr avatar stevenbirr commented on June 1, 2024

.., Sorry, have to rectify... For me, it does still not work. Sometimes hot code reloading works, sometimes not. Very strange...

from react-hot-boilerplate.

MaronMariusz avatar MaronMariusz commented on June 1, 2024

What I noticed this is all about some bad settings/packages/versions in node. At work I normally installed boilerplate and it was working like a charm. At home I have problems. I need to reinstall completely my env ^^

from react-hot-boilerplate.

thenewvu avatar thenewvu commented on June 1, 2024

I have experienced this issue. I tried @stevenpietzsch's solution and it seems working but no idea what I'm doing actually. Where the problem comes from is my concern now, any idea?

from react-hot-boilerplate.

StefanHinck avatar StefanHinck commented on June 1, 2024

Yep @stevenpietzsch your addition worked for me as well. So my server.js now looks like:

new WebpackDevServer(webpack(config), {
  publicPath: config.output.publicPath,
  hot: true,
  historyApiFallback: true,
  watchOptions: {
    aggregateTimeout: 300,
    poll: 300
  },...

I have no idea what this addition changes though, care to clarify a bit?

from react-hot-boilerplate.

OXOYO avatar OXOYO commented on June 1, 2024

@stevenpietzsch Yeah! It works! Thansk! But there should not be a default configuration.

from react-hot-boilerplate.

alphanumeric0101 avatar alphanumeric0101 commented on June 1, 2024

This is all very confusing. I tried @Prophet32j's recommendation and that got my app refreshing completely upon each update. I then put back 'hot: true' and tried what @stevenpietzsch suggested and now it updates only the specific component when it detects a change, checking every .3 seconds I assume?

from react-hot-boilerplate.

alphanumeric0101 avatar alphanumeric0101 commented on June 1, 2024

thanks @stevenpietzsch, I'll look into this but I'm just using sublime and running from my terminal... will let you know if I find any kind of safe mode though.

from react-hot-boilerplate.

gaearon avatar gaearon commented on June 1, 2024

Closing as most of it is related to Webpack, and we can’t fix these issues here.

from react-hot-boilerplate.

erchaves avatar erchaves commented on June 1, 2024

Not sure this is relevant, but leaving a note just in case: I had a strange and subtle hot-reloading bug due to a caps case issue. When my file path used the incorrect casing, everything still worked except for hot-reloading on that module. The app was working, but hot-reloading failed silently.

I changed the incorrect import Home from '../components/Home'; to the correct import Home from '../Components/Home'; ('C' -> 'c') and hot reloading worked again. Sneaky.

It looks like caps-case issues have bitten others in similar situations: #8

from react-hot-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.