Comments (11)
You can specify it in the path
for webpack-hot-middleware/client
:
entry: [
'webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr',
'./src/index'
],
You may also need to set CORS headers on responses from devServer.js
:
app.use(function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
});
from react-transform-boilerplate.
@razh 👍 big thanks
I stumbled upon same problem while trying to integrate with php project
from react-transform-boilerplate.
No, this didn't help :(
Specifying ?path=http://localhost:3000/__webpack_hmr DOES provide access to __webpack_hmr at custom port 3000
But after triggering first source change - server returns SINGLE response with content of my static html file, not JSON with list of updates as I might expect. (it does return correct JSON response in case using same port for both server and webpack-hot-middleware)
Remote Address:127.0.0.1:80
Request URL:http://localhost/static/12813d883d25bbe64a3f.hot-update.json
Request Method:GET
Status Code:200 OK
Response
<!doctype html>
<html>
<head>
<title>React Transform Boilerplate</title>
</head>
<body>
<div id='root'>
</div>
<script src="http://localhost:3000/static/bundle.js"></script>
</body>
</html>
Afterwards it ignores next update triggers and don't respond at all.
Does someone found workaround for this?
from react-transform-boilerplate.
Aha, okay.
http://localhost:3000/static/12813d883d25bbe64a3f.hot-update.json
returns correct JSON.
How to force webpack-hot-middleware to make call with 3000 port?
from react-transform-boilerplate.
You don't have to use Webpack Hot Middleware.
Just keep using Webpack Dev Server if that works for you. :-)
from react-transform-boilerplate.
I've never used Webpack Dev Server before but for curiosity tried it just a moment ago and experienced same behaviour.
Anyway finally I made it work by setting in webpack.config
{
output: {
..
publicPath: 'http://localhost:3000/static/'
}
}
from react-transform-boilerplate.
I've never used Webpack Dev Server
What did you use with React Hot Loader?
from react-transform-boilerplate.
Out of curiosity, why do you prefer webpack-dev-middleware
over webpack-dev-server
?
from react-transform-boilerplate.
@nlhkh webpack-dev-middleware
if you are using a dynamic server.. you'd want to add the middleware that way all connections to DB or API's and process work.. Using just webpack-dev-server
would have to do a bunch of work around to achieve what you can achieve with webpack-dev-middleware
out-of-the-box.
from react-transform-boilerplate.
The entry
settings that @razh offered work for me in getting react-transform working with Django. 👍
from react-transform-boilerplate.
Closing as non-actionable.
from react-transform-boilerplate.
Related Issues (20)
- Do we need babel-polyfill in production HOT 1
- React transform or hmre? HOT 1
- Debug in devtools HOT 1
- Can you give an example of how to use with webpackDevServer? HOT 3
- Feature request: Built in redux-devtools HOT 1
- console shows error: Uncaught Invariant Violation HOT 5
- github archive doesn't contain .babelrc HOT 1
- How to view app in mobile device? HOT 2
- There are some problem and suggest. HOT 1
- Weird behaviour when adding text HOT 3
- If "full reload needed" does this need to be manually? HOT 5
- Problems with NoErrorsPlugin HOT 2
- Doesn't work with react Component class wrapper HOT 3
- Error when using Webpack 2 and es2015-webpack preset HOT 4
- Doesn't work with React-Router :( HOT 5
- Failed at start script 'NODE_PATH='source' node devServer.js' HOT 1
- How to load css
- React.PureComponent doesn't work with HMR HOT 2
- Stateless functional component not hot reloading HOT 1
- hotReload is not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-transform-boilerplate.