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
14
votes
6 answers

"Cannot read property 'upgrade' of undefined" when starting vue application

I have a project that's been running perfectly for a few months now, able to run npm run serve with no problem. I have to terminate and run the command again whenever I switch networks, but that has never been a problem and the server could always…
kkontagion
  • 456
  • 1
  • 3
  • 12
14
votes
2 answers

What's the replacement for webpack-dev-server in Webpack 4?

I've noticed that installing webpack-dev-server@webpack/webpack#next actually installs webpack (without any warning). However, there's no webpack-dev-server executable any more. Is there a replacement for this in Webpack 4, or do I need a separate…
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
14
votes
1 answer

Angular 5 unable to get XSRF token from HttpXsrfTokenExtractor

I am trying to make a POST request via an absolute URL to a Spring (Basic authentication) secured Rest API. Having read that Angular omits inserting the X-XSRF-TOKEN into the request header automatically for absolute urls, I tried to implement an…
Glenster
  • 1,187
  • 2
  • 13
  • 31
14
votes
3 answers

Ignoring files with Webpack Dev Server

I am using Emacs to edit the files in directories watched by Webpack's development server. Every time I make a change in a file, a backup file gets created in the same directory, like .#original_filename, even though I did not save the changes in…
osolmaz
  • 1,873
  • 2
  • 24
  • 41
14
votes
6 answers

Console logging error on bundle.js instead of React component

I have created a Webpack build which works fine for me - it has a dev-server which I use for hot-reloading, and a production express server that runs a template html file and integrates the bundle.js file. This is all great, except when I'm working…
Paulos3000
  • 3,355
  • 10
  • 35
  • 68
14
votes
2 answers

webpack-dev-server: how to get error line numbers of orignal files

With webpack-dev-server running it seems that all errors in the output are pointing to line numbers in the bundle.js and not the original source file. How do I get line numbers of the original source files? I'm using webpack with babel for ES2015…
Steffen
  • 3,327
  • 2
  • 26
  • 30
14
votes
2 answers

how to proxy to backend server on certain path?

Here is the routes config: Here is the proxy config for…
eyakcn
  • 141
  • 1
  • 5
14
votes
3 answers

Webpack Error - Cannot Resolve File or Directory

I am getting this error when I npm start my webpack-dev-server: ERROR in multi main Module not found: Error: Cannot resolve 'file' or 'directory' /var/www/html/151208-DressingAphrodite/app in /var/www/html/151208-DressingAphrodite @ multi…
Kayote
  • 14,579
  • 25
  • 85
  • 144
14
votes
1 answer

404 because of restarting the webpack-dev-server

I'm getting this in my developer tools when I try change my react component and save it to see if hot loader updated my page: GET http://localhost:3000/public/bundle/76566a1ad7e45b834d4e.hot-update.json 404 (Not Found)hotDownloadManifest @…
Liondancer
  • 15,721
  • 51
  • 149
  • 255
13
votes
2 answers

Vue cli 3 project ,dynamic src in image path not working

I am referencing an image url in a vue component like Vue logo this works but while trying Vue logo data() { return { imgPath: "~statics/reports/logo.png" }; }, …
Sainath S.R
  • 3,074
  • 9
  • 41
  • 72
13
votes
2 answers

Webpack dev server - run multiple apps on multiple ports

Currently I run two apps that sits on the same repo. The first one runs on / and the other one on port 3000 (different HTML files). I want to make another app that will run on port 5000 (with it's own HTML file). How can I do that? This is my…
Nir Ben-Yair
  • 1,566
  • 3
  • 14
  • 18
13
votes
1 answer

Webpack dev server cache clearing

I can't get webpack dev server to work properly. I think the issue is the compiled code it makes in memory is not clearing. I can't work out where I'm going wrong. My config file is: var path = require('path'); const MiniCssExtractPlugin =…
Raph117
  • 3,441
  • 7
  • 29
  • 50
13
votes
1 answer

webpack dev server Failed to load resource

The problem is that I get this very error Failed to load resource: the server responded with a status of 404 (Not Found) when I use webpack-dev-server. But if I just build the project then I can run my index.html and get the expected result. My…
Igor Chernega
  • 611
  • 3
  • 7
  • 18
13
votes
5 answers

webpack not generating source maps

webpack.config.js const path = require('path'); const webpack = require('webpack'); module.exports = { entry: './src/index.js', plugins: [ new webpack.HotModuleReplacementPlugin() ], output: { filename: 'bundle.js', …
Carpetfizz
  • 8,707
  • 22
  • 85
  • 146
13
votes
2 answers

CORS error even after setting Access-Control-Allow-Origin or other Access-Control-Allow-* headers on client side

I have a Vue application generated with webpack-simple option. I am trying to make a GET request to https://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en but I get the error: XMLHttpRequest cannot load …
wrahim
  • 1,158
  • 4
  • 16
  • 33