My webpack-dev-server normally works as it should, live updates are working, everything's great.
However, if I ever save a file with a syntax error, the server stops compiling and requires me to restart it to get it working again.
For example, say I accidentally add an extra comma to a .scss file, the webpack-dev-server outputs the error:
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after '...oto Condensed",': expected expression (e.g. 1px, bold), was ", sans-serif;"
on line 18 of /Users/r/Documents/sol/src/styles/app.scss
>> font-family: "Roboto Condensed",, sans-serif;
----------------------------------^
@ ./src/styles/app.scss 2:26-181
@ ./src/index.jsx
ℹ 「wdm」: Failed to compile.
But when I fix the error by removing the comma and save the file, the server doesn't recompile like it normally does (it doesn't seem to output anything at all). I have to kill the webpack-dev-server and restart it.
The closest thing I've found online to my issue was this https://github.com/webpack/webpack-dev-server/issues/463, but the solutions there didn't fix my issue.
Here is my webpack.config.js:
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'src', 'index.jsx'),
output: {
path: path.resolve(__dirname, 'output'),
filename: 'bundle.js'
},
devServer: {
publicPath: '/output/',
contentBase: path.resolve(__dirname, 'src'),
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.jsx/,
use: {
loader: 'babel-loader',
options: { presets: ['@babel/preset-react', '@babel/preset-env'] }
}
},
{
test: /\.scss/,
use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']
}
]
}
};
Is it normal behavior for the server to stop compiling after an error? Or is there a flag I can change so I don't have to restart the server after every syntax error?