Webpack - webpack-hot-middleware error for only first change/save

Viewed 145

I'm using a bare bones webpack configuration based off the webpack documentation. Currently I'm getting two errors and one warning whenever I save changes. These errors and warning only occur once together after I make the first change. Proceeding changes/saves to my .js files however don't cause any errors or warnings. Does anyone know how to make the below errors/warnings go away, know what causes it and if it will cause problems further in development?

Errors/warning (pastebin because Stackoverflow doesn't like the indentation of the errors):

https://pastebin.com/qEbF2nRs

Picture version:

enter image description here

My Code (pastebin because Stackoverflow doesn't like the indentation of something but I can't find it and it's driving me crazy):

https://pastebin.com/kkrAnfyW

Here's my server.js

const express = require("express");
const webpack = require("webpack");
const webpackDevMiddleware = require("webpack-dev-middleware");
const webpackHotMiddleware = require("webpack-hot-middleware");

// App Setup
const app = express();
// Compiler Setup
const config = require("./webpack.config.js");
const compiler = webpack(config);

// Make express use webpack dev/hot middleware + webpack.config
app.use(webpackDevMiddleware(compiler, {publicPath: config.output.publicPath,}));
app.use(webpackHotMiddleware(compiler));

// Server Listen
app.listen(3000, function () {console.log("Example app listening on port 3000!\n");});

Folder Structure:

enter image description here

0 Answers
Related