React Hot Loader doesn't work if React is external (CDN)
See original GitHub issueHi there,
Given:
module.exports = {
externals: {
react: 'React',
'react/addons': 'React',
'react-router': 'ReactRouter'
}, ...
and:
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react-with-addons.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/react-router/0.11.6/react-router.min.js"></script>
in the html. Then the React Hot Loader doesn’t work. I see this in the console:
[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.
[WDS] App updated. Recompiling...
[WDS] App updated. Recompiling...
[WDS] App hot update...
[HMR] Checking for updates on the server...
[HMR] Updated modules:
[HMR] - 20
[HMR] App is up to date.
but I don’t see the changes getting reflected in the view. It’d work however If I commented out the externals configuration and the script lines in the html (getting webpack to use NPM react packages).
The console output is almost the same as above except that [HMR] - 20 was [HMR] - 19.
Any suggestions on how to debug/fix this would be welcome. Confirmation that anyone has successfully used React Hot Loader with external React resources would be great too.
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Can't make react-hot-loader and webpack-dev-server work ...
I'm trying to use react-hot-loader with webpack-dev-server and react-router , but when I try to access localhost:3000/ I get : Cannot GET /....
Read more >file-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >react-hot-loader | Yarn - Package Manager
Troubleshooting. If it doesn't work, in 99% of cases it's a configuration issue. A missing option, a wrong path or port. webpack is...
Read more >Getting Started · React Hot Loader - Dan gaearon
React Hot Loader is a plugin that allows React components to be live reloaded without the loss of state. It works with Webpack...
Read more >Advanced Configuration - Create React App
Variable Development Production
BROWSER ✓ Used 🚫 Ignored
BROWSER_ARGS ✓ Used 🚫 Ignored
HOST ✓ Used 🚫 Ignored
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@gaearon In product env, use externals, and the addons had to declare like this
const update=React.addons.update. But in dev env, use NPM package, you shouldimport update from 'react-addons-update. That made me confused, for consistency, I had to use externals in dev. Is there any solution? I’m waiting online. Thank you.@gaearon but now appears this; if I use ReactDOM to render (the correct way):