Comments (14)
@glenjamin Thanks for the response. I removed it 'webpack-hot-middleware/client',
from entry in webpack, however I am still seeing requests on server. Not sure why that is.
-- update -- it was a cache problem.
removing `'webpack-hot-middleware/client' fixed problem.
Thanks!
from webpack-hot-middleware.
Without webpack running in my project, I consistently see requests to __webpack_hmr:
GET /__webpack_hmr 200 1.254 ms - 2092
GET /__webpack_hmr 200 3.087 ms - 2092
GET /__webpack_hmr 200 2.264 ms - 2092
When running my express server on a different port than what was used for my project using webpack, I can avoid these requests. They don't actually affect my project, but are extremely annoying. Is webpack_hmr running in the background? Is there a way to prevent this?
@glenjamin
from webpack-hot-middleware.
@wassubaba Late to the party, but in case others stumble upon this, it looks like you forgot a slash after your hostname. The correct HMR URL should be your.domain/__webpack_hmr
.
All in all, it would be great to be able to change the __webpack_hmr
part into something custom. The use case is running one HMR at localhost
, and another at localhost/foo
. Without being able to specify a custom URL, it's necessary to do custom URL rewriting rules or use odd hacks to get it working.
from webpack-hot-middleware.
What version of express are you using?
http://expressjs.com/4x/api.html#req.path should exist.
There's been a few issues with the eventsource polyfill - i'm going to revert those changes and unpublish 2.0.1
for now. Can revisit it with more testing.
from webpack-hot-middleware.
v2.0.1
has been marked deprecated and v2.0.2
released without the eventsource polyfill dfb7efb
from webpack-hot-middleware.
@glenjamin don't you want to keep it working with non Express servers? E.g. when you need to launch a dev server by using BrowserSync (which uses Connect under the hood).
from webpack-hot-middleware.
@koistya - I do want to work with non-express servers - yes!
I've closed this PR because the same change was made in dfb7efb
from webpack-hot-middleware.
Thanks! 2.0.2
works fine with BrowserSync now
from webpack-hot-middleware.
If you have the client in your bundle, it will continuously attempt to connect to the server. If you want to remove the client, you need to leave it out of the client bundle.
from webpack-hot-middleware.
@glenjamin I know this is a little old but I am having the same problem @hoodsy is asking about. my my backend API are not bundle with client but stilling seeing the request to _webpack_hmr. You you help me understand what you mean by "If you want to remove the client, you need to leave it out of the client bundle."
Thanks
from webpack-hot-middleware.
@travisbmiller in your webpack config there's a line which adds the hot-middleware client to the bundle. If you leave this out, it won't attempt to connect to the server
from webpack-hot-middleware.
@glenjamin Thanks for the direction. Removing 'webpack-hot-middleware/client' from 'entry' section fixed this.
Just wanted to understand, why this setting was suggested in the 'entry' section of react hot boilerplate?
from webpack-hot-middleware.
@jsrraman If you add that into the config, it will connect to the server and perform the function this middleware is supposed to do.
If you take it out, it won't do anything. In the comments above people appeared to have disabled or moved the server component, but had left the client in.
from webpack-hot-middleware.
Hi glenjamin,
I am getting the below exception while trying to connect from web to api.
"Uncaught DOMException: Failed to construct 'EventSource': Cannot open an EventSource to 'http://localhost:8080__webpack_hmr'. The URL is invalid."
Could you please help me to resolve this problem ?
from webpack-hot-middleware.
Related Issues (20)
- TypeError: cb is not a function HOT 1
- error TS2339: Property 'compilers' does not exist on type 'Compiler'. HOT 1
- Which package to use on a Deno server? HOT 1
- `webpack-hot-middleware/client?reload=true` is no longer working with webpack 5. HOT 36
- not work on webpack5 HOT 7
- Overlay is not working with Webpack 5 HOT 4
- Ignored an update to unaccepted module - No automatic page reloading with recent versions of webpack and react packages HOT 3
- Types are broken with Webpack 5 HOT 3
- `module.hot` is required ?
- enable use of other backends besides express
- when updating the example everything will break please update HOT 4
- ReDoS Vulnerability HOT 2
- Replace deprecated querystring component with builtin URLSearchParams API HOT 8
- Overlay is invalid in webpack5. Haven't you solved it yet? How long do you plan to publish it to the master? I hope you can reply
- Hot Updates not being handled by server HOT 2
- Opening 5+ tabs causes Express to hang indefinitely HOT 2
- webpack-hot-server-middleware on demand loading bug
- webpackv5 webpack-hot-server-middleware Compatibility problems HOT 1
- A Chrome specific issue, where requests are getting blocked after a handful of link clicks HOT 3
- Webpack 5: incorrect compilation error text output starting with "undefined undefined" HOT 3
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 webpack-hot-middleware.