MERN Stack(Typesctipt Webpack setup) Always throwing error when I send axios request

devServer: {
    historyApiFallback: true,
    port: 3000,
},

you have to specify the contentBase.

devServer: {
    historyApiFallback: true,
    port: 3000,
    contentBase: path.join(__dirname, 'dist'),
},

so wehpack dev server will serve all the files in dist directory. this will solve the current error but then you will get another error because you dont have entry property in webpack.config.js

 entry:"src/app.js" // path to main file of your app