Closed firatsarlar closed 6 months ago
I've also tested vite, same problem. Not sure but this problem may be bound to "expressjs " ( if both dev servers depend on it )
The problem was related to Windows defender firewall. Even though the local inbound - outbound rules were working normally and all ports were open, the problem disappeared when I reset the firewall settings and re-created the rules.
Bug Report
When the Webpack Dev Server is initiated, it functions correctly on the host machine using
localhost
and local IP addresses (e.g.,192.168.xxx.xxx
). However, attempts to access the dev server from other devices on the same local network, such as phones, tablets, or even a virtual machine, fail despite the server being reachable at these addresses on the host machine. This issue occurs even though a simple Python HTTP server set up under similar conditions is accessible across all devices on the same network.Actual Behavior
The Webpack Dev Server starts normally and is accessible via
localhost
and its local IP address on the host machine. Despite the firewall being configured to allow local network traffic and successfully serving a simple Python HTTP server across various devices (confirmed by testing), the Webpack Dev Server cannot be accessed from any other device on the same network.Expected Behavior
The Webpack Dev Server should be accessible from any device within the same local network, mirroring the behavior observed when accessing a simple Python HTTP server under similar network conditions. I expect to view and interact with the webpage I'm developing, just as it appears on my local development machine, using the server's local IP address or hostname.
How Do We Reproduce?
To reproduce the issue, follow these steps using the provided GitHub repository:
npm install
to install necessary dependencies.npm run build
to build the project, which prepares thedist
directory with the necessary files.npm start
to start the Webpack development server. The server should now be accessible viahttp://localhost:8080
andhttp://192.168.1.50:8080
on the host machine.npm run python_serve
to serve thedist
directory using Python's built-in HTTP server. This server will be accessible viahttp://192.168.1.50:8000
.http://192.168.1.50:8080
for the Webpack Dev Server andhttp://192.168.1.50:8000
for the Python server. The Python server should be accessible, whereas the Webpack Dev Server might not be.Please paste the results of
npx webpack-cli info
here, and mention other relevant informationSystem: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz Memory: 16.00 GB / 31.94 GB Binaries: Node: 22.0.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 9.6.6 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Chromium (123.0.2420.97) Packages: html-webpack-plugin: ^5.6.0 => 5.6.0 webpack: ^5.91.0 => 5.91.0 webpack-cli: ^5.1.4 => 5.1.4 webpack-dev-server: ^5.0.4 => 5.0.4