Questions tagged [webpack-dev-server]

a Node.js based server that supports live reloading and is used for development of webpack powered applications.

webpack-dev-server is a little Node.js Express server, which uses the webpack-dev-middleware to serve a webpack bundle. It also has a little runtime which is connected to the server via Socket.IO. The server emits information about the compilation state to the client, which reacts to those events by updating the bundle.

The server is used for development purpose only.

3256 questions
37
votes
2 answers

How to configure webpack dev server with react router dom v4?

This is the code of my webpack configuration: const compiler = webpack({ entry: ['whatwg-fetch', path.resolve(__dirname, 'js', 'app.js')], module: { loaders: [ { exclude: /node_modules/, test: /\.js$/, …
gpbaculio
  • 5,693
  • 13
  • 60
  • 102
37
votes
2 answers

unable to see request logs in webpack-dev-server

I am using webpack-dev-server to act as a CDN server locally to serve various static assets like css, js, html etc. Everything runs fine but for debugging purposes, I am unable to see the requests received by the CDN server. webpack-dev-server just…
comiventor
  • 3,922
  • 5
  • 50
  • 77
37
votes
9 answers

Webpack - background images not loading

I'm fairly new to webpack but having some problems with css-loader or file-loader. I'm trying to load a background-image but it doesn't work quite right. The background-image isn't shown, even though the devtools show the background-image style.…
Eric
  • 917
  • 2
  • 9
  • 16
36
votes
4 answers

Proxy requests to a separate backend server with vue-cli

I am using vue-cli webpack-simple template to generate my projects, and I'd like to proxy requests to a separate, backend server. How can this be easily achieved?
Mahmud Adam
  • 3,489
  • 8
  • 33
  • 54
35
votes
5 answers

Cannot GET / error running hello world in webpack

Full Github project: https://github.com/pbrianmackey/uiexperiment I run webpack-dev-server --content-base deployment/ Then go to http://localhost:8080/, Error Cannot GET / I think the problem is a misconfiguration of webpack. I checked by…
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
35
votes
2 answers

Mocha tests don't run with Webpack and mocha-loader

Background I am porting some npm scripts to Webpack loaders to better learn how Webpack works and I’ve got everything working except for my Mocha tests: I have one failing test, but it is not showing that Mocha is being run with the mocha-loader or…
user3773571
33
votes
12 answers

EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module'

I'm trying to lazy load Angular 2 modules with the router, and I'm having this error: error_handler.js:50 EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module' I tried all the answers that seems to be working for the…
33
votes
9 answers

historyApiFallback doesn't work in Webpack dev server

I use Webpack dev server and browserHistory in React Router to manipulate with urls by HTML5 History API. historyapifallback-option does not work in my webpack config file. After refreshing http://localhost:8080/users or…
Matt
  • 8,195
  • 31
  • 115
  • 225
32
votes
5 answers

How to detect if webpack-dev-server is running?

How can I determine if webpack.config.js was loaded via webpack vs webpack-dev-server?
mpen
  • 272,448
  • 266
  • 850
  • 1,236
31
votes
5 answers

Getting "Error: `output.path` needs to be an absolute path or `/`"

I am new to JS development, in an attempt to hot load changes using webpack-dev-server I keep above exception. The exact stack is: Error: `output.path` needs to be an absolute path or `/`. at Object.Shared.share.setFs…
bluefalcon
  • 505
  • 1
  • 5
  • 21
31
votes
3 answers

Webpack hmr: __webpack_hmr 404 not found

I'm using webpack-dev-server for hot module replacement. It's working just fine, but this error keeps showing up in the console every couple of seconds: GET http://mysite:8080/__webpack_hmr 404 (Not Found). Here's my webpack.config.js: var webpack =…
hansn
  • 1,936
  • 3
  • 19
  • 32
31
votes
4 answers

Cannot run webpack-dev-server inside docker

I have created a docker image which serves a simple react app using webpack from inside the container, but I get nothing in the browser. Here are my config files package.json { "name": "invas_client", "version": "1.0.0", "description": "", …
Anubhav Dhawan
  • 1,431
  • 6
  • 19
  • 35
30
votes
1 answer

what's the difference between webpack:// and webpack-internal://

I'm writing a webpack-react-typescript kit, and I've found that the source-map can't direct to the source code. It directs to the webpack-internal://src/App.tsx file, this file has some webpack injection code. Another computer has both the…
mrkou47
  • 351
  • 3
  • 6
30
votes
4 answers

Content not from webpack is served from /foo

I just can't start this server, I read the webpack-dev-server docs. devServer: { contentBase: path.join(__dirname, "dist"), compress: true, port: 9000 } The sample code looks simple,but I just can't start this server successfully,no matter…
McGrady
  • 10,869
  • 13
  • 47
  • 69
29
votes
6 answers

"Invalid Host Header" in When running React App

I am having one simple project of React JS and I am deploying into OSE. Also I am using below dependencies in my project. "webpack": "^2.2.0", "webpack-dev-server": "^1.14.1", "react": "^15.5.4", "react-router-dom": "^4.1.1" also I am running…