-
Notifications
You must be signed in to change notification settings - Fork 799
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
Changes not been propagated #1210
Comments
I dont see any mistakes. All correct. Anyway - try to remove following code from your index.ks if (module.hot) {
module.hot.accept()
if (appContainer) ReactDOM.render(<App />, appContainer)
else if (appContainer) {
ReactDOM.render(<App />, appContainer)
} should be just ReactDOM.render(<App />, appContainer); // which by your conditions always exists. |
Thanks for the quick answer @theKashey, although it didn't work. I went a little further and added why-did-you-update library to the project (which you probably know), and for my surprise the components are 'apparently' re-rendering, although no visual changes. Check the screenshots attached. And just below I completely lost. I doesn't make any sense at all. |
The only other 'thing' unusual on this project is the fact that we are instantiating socket.io for different purposes... this is my whole configuration for webpack-dev-server
Which I commented out and didn't had any effect, but other than that everything else is pretty 'vanilla'. |
import {setConfig} from 'react-hot-loader';
setConfig({
ignoreSFC: true,
ignoreClases: true,
// optional
disableHotRenderer: true
})
If it would work - then something is broken inside RHL(try to unignore stuff, untill it got broken back) |
Alright @theKashey, I run a few scenarios: Scenario 1: Note: In this scenario I'm still exporting my application with As per my App, it didn't update at all, there were less re-rendering though as the screenshot below shows. This is my console: Scenario 1 - Variation 1 (disabling ignoreSFC): Again, nothing was updated on my App, no reload, no nothing other the this console (that looks fairly similar to the previous one Scenario 1 - Variation 2 (disabling ignoreClasses): Exactly the same, more warning about react-dom, very similar console and no App updates at all. Scenario 1 - Variation 3 (disabling disableHotRenderer): Follow console (note the scollbar): I was almost giving up and believing that there was something wrong my App, configurations, library versions or whatever, but then I decide try another scenario. Scenario 2: Basically I soft removed react-hot-loader, even though there's still a little bit of left over on webpack ( For my surprise when I change the code, it loose the state, but the Application refreshes. Interesting... during one of the refreshes I noticed a warning that was literally impossible to read, so I quickly changed my webpack-dev-server from Which to me is kind of weird... by the way: I really don't know what else I could have tried... Maybe something to do with react-router-dom? Just in case I'm using version 4.3.1. That's it. |
Any ideas @theKashey ? |
Sorry, I've missed your report. In short - no ideas. I never saw a problem like this. And look like Hot-Loader is installed correctly, as long as it's uninstalling changing things as expected.
Could I kindly ask you for an example? If it's not quite public you can send me just zip file to play with. |
Sure not problem, I sent you a link with the instructions, hope to hear back from you soon. I hope it is something stupid that I did... Appreciate your effort trying to help. |
Got it. Looking. |
Great, let me know if you having any issues running it, I'll be online for the next couple hours. Once again, thank you. |
It's strange - you added it after having problems with update, but everything could be fixed by removing it. |
In your case on every HMR you were applying a new So - remove I will investigate how they could live together, but it could be not easy due to memoization inside |
Oh my gosh, so the installation is ok so long I remove why-did-you-update? Or install it above RHL? What you referring to when you say awesome tool? Thank you so much!!!! |
Create 2 files (function() {
// trying to hide everything in a closure from babel plugin
// to not let it import RHL before
if (process.env.NODE_ENV !== 'production') {
const {whyDidYouUpdate} = require('why-did-you-update');
whyDidYouUpdate(require('react'));
}
})(); // patches.js
import 'why-did-you';
import 'react-hot-loader'; replace Probably would work, the trick is with babel plugin, which will add RHL import to the every file. |
After further investigation, I have found these instructions to fix my previous issue with time traveling after editing a components props (The hot update is received and correct, but the component either doesn't get updated or disappears). I have not had a chance to start re-enabling things to pinpoint the culprit yet, though. |
There is an issue which exists "with" |
Interesting. I suspect that this is my issue. Do you have any idea when it will be fixed? |
Today - #1348 |
Description
react-hot-loader seems to be doing everything right, it detect module changes and apparently update the modules, although the browser content doesn't reflect the code changes at all. No errors, no warnings.
Expected behavior
Browser content should be updated reflecting the changes.
Actual behavior
Console spits (e.g.):
[WDS] App updated. Recompiling...
[WDS] App hot update...
[HMR] Checking for updates on the server...
XHR finished loading: GET "http://localhost:8080/df32ff4...hot-update.json.
[HMR] Updated modules:
[HMR] - ./src/library/protons/ModalWorkflow/sandbox/workflowStepOne.js
[HMR] - ./src/library/protons/ModalWorkflow/sandbox/index.js
[HMR] - ./src/configs/routes.js
[HMR] - ./src/views/intro/index.js
[HMR] - ./src/view/home/index.js
[HMR] - ./src/app.js
[HMR] App is up to date.
No Browser content changes.
Environment
React Hot Loader version: 4.8.0
react:16.8.3
react-dom: (patched by react-hot-loader ) - 16.8.3
webpack: 4.29.6
webpack-dev-server: 3.2.1
Run these commands in the project folder and fill in their results:
node -v
: 8.15.1npm -v
: 6.9.0Then, specify:
Reproducible Demo
I didn't setup a project, I may be wrong but I strongly believe it is something to do with configuration, which follows below:
webpack-dev-server config
historyApiFallback: true,
hot: true,
stats: 'none',
quiet: true,
port: port,
host: host,
webpack config
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index.js',
],
resolve : {
alias: {
'react-dom': '@hot-loader/react-dom'
}
},
.babelrc
"plugins": [ "@babel/plugin-transform-flow-strip-types", "@babel/plugin-proposal-class-properties", "react-hot-loader/babel" ]
App component
import React, { Component } from 'react'
import { hot } from 'react-hot-loader/root'
class App extends Component<PropTypes, StateTypes> {
render (): React$Element<*> {
return (
<Router>
<Switch>
<Route
path="/home"
render={ (props: Object): React$Element<*> => <HomeView {...props } /> }
/>
<Route component={ IntroView } />
</Switch>
</Router>
)
}
}
export default hot(App)
my entry file
import React from 'react'
import ReactDOM from 'react-dom'
import App from './app'
const appContainer = document.getElementById('appContainer')
if (module.hot) {
module.hot.accept()
if (appContainer) ReactDOM.render(<App />, appContainer)
else if (appContainer) {
ReactDOM.render(<App />, appContainer)
}
The text was updated successfully, but these errors were encountered: