Questions tagged [webpack-dev-middleware]

handles latest webpack output in memory for Express (node platform) web server (so it is an Express middleware)

Supports Hot Module Reload (HMR).

Used by webpack-dev-server internally (webpack-dev-server is a complete preconfigured Express server distribution)

https://github.com/webpack/webpack-dev-middleware

103 questions
5
votes
1 answer

Can't get a multi-app webpack configuration to work with react-hot-loader

I have a basic setup with two apps each in a separate directory, I'm using a custom server to compile them using webpack-dev-middleware/webpack-hot-middleware. Things are working fine except that I can't get HMR to work for the second app (I'm using…
5
votes
1 answer

Cannot GET / error with my webpack-dev-middleware setup

First of all, I found many similar topics here but even after referring to them, I still haven't been able to get it working at all. So, my problem simply is that I get Cannot GET / in Chrome when I visit localhost:3000 after running my express…
4
votes
0 answers

Module not found: Error: Can't resolve 'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true' when using webpack-hot-middleware

I am using webpack-hot-middleware for hot module replacement for javascript ui scripts in an express app. Whenever I start the server, I get this error: Module not found: Error: Can't resolve…
4
votes
0 answers

How to load the js generated from webpack-dev-middleware and start that js

I am new to Node JS. I am working on creating a Backend API server with hot reloading by using webpack-hot-middleware. I try to use webpack-dev-middleware to load the server script (index.js) to the memory and execute that javascrip t file. Here is…
4
votes
2 answers

Matching root route in webpack-dev-server's historyApiFallback`

Sample repo demonstrating the issue is here. I'm trying to set up webpack dev server so that: Requests to / are served by public/landing.html (a static landing page) Requests to anything else are served by my React app Using create-react-app, and…
3
votes
0 answers

Why am I getting "Cannot find module..." Typescript error for ".vue" file on webpack-dev-server recompilation?

I've setup a small webpack project which creates a Vue app bundle which is included in a static HTML file where the app is injected. I want to have components written in Typescript so I've included ts-loader in the webapck configuration. The build…
3
votes
0 answers

how to use webpack-dev-middleware with typescript?

I'm trying to implement a simple backend app with express + webpack + babel + typescript, I've seen examples of webpack-dev-middleware where the start script is simply "node index.js", as I understand it, an in-memory server is created with your…
3
votes
0 answers

How to use webpack-dev-middleware with split web/server packages?

I've just split up my monolith webpack/koa project into multiple packages using yarn workspaces. I have one package that I call "web" which is just the webpack build. Then I have another one called "server" which is koa serving both the webpack…
Viktor Hedefalk
  • 3,572
  • 3
  • 33
  • 48
3
votes
0 answers

HapiJS + create-react-app + webpack-dev-middleware configuration

I am currently using a create-react-app with HapiJS as a proxy for serving the static files. This is how my current setup looks like: //server.js const server = new Hapi.Server({ port: process.env.PORT || 80, routes: { …
PsyGik
  • 3,535
  • 1
  • 27
  • 44
3
votes
0 answers

Nodemon watch triggers webpack dev middleware rebuild

I am using webpack-dev-middleware along with expressjs to watch and serve files emitted from webpack. Have setup expressjs server with nodemon so that it can watch any server code changes. The issue is, for any change detected by nodemon, the server…
Easwar
  • 5,132
  • 1
  • 11
  • 21
3
votes
1 answer

webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed

I don't have webpack-dev-middleware installed in my project but when I build it using webpack it throws below warning. webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed Below are webpack…
Hemadri Dasari
  • 32,666
  • 37
  • 119
  • 162
3
votes
0 answers

Webpack 4 Extracted SCSS Hot-Reloading w/ Dev-Middleware

I would like to use webpack-hot-middleware to work(hot reload) on extracted css files when using webpack-dev-middle with express server. It works fine with webpack-dev-server. But I want to use it with express. server.js const express =…
3
votes
0 answers

webpack-dev-middleware with HMR behind reverse proxy in IIS

I'm trying to setup webpack with Hot Module Replacement and reaching it through a reverse proxy in IIS using the Rewrite module My simple rewrite rule:
Cotten
  • 8,787
  • 17
  • 61
  • 98
3
votes
0 answers

Webpack-dev-middleware returns a 404 when I refresh

I'm was trying to set up webpack-dev-middleware with a react-redux-app. If I refreshed the homepage, I received a 200 status code. But if I refreshed on any other page ('/signin'), I would get a 404 error. After some Googling, I found this on…
3
votes
2 answers

ASP.NET Core The system cannot find the file specified

I have followed this tutorial on getting angular and ASP.NET Core running together. The initial build worked fine but after updating angular packages I am receiving the following error on startup of the application(I also had to reinstall nodejs in…