codymikol / karma-webpack

Karma webpack Middleware
MIT License
829 stars 220 forks source link

Issue with Webpack 5 unable to find file 404 (works with webpack 4) #546

Closed ankitdadhich closed 9 months ago

ankitdadhich commented 1 year ago

Actual Behavior

Code

Debug Log packages.json https://gist.github.com/ankitdadhich/24c5e031a1a6ff447a1418f4a27472bb karma test debug log error with webpack 5 https://gist.github.com/ankitdadhich/0a046e4e843237137b7340c6a0edb719 karma test debug log working sample with webpack 4 https://gist.github.com/ankitdadhich/3e452bfc2c30c965531f17eb81f8c23f webpack.config.js https://gist.github.com/ankitdadhich/df1db0ff4483845c640eae3c46cbe174

How Do We Reproduce?

Issue with Webpack 5. Just use above latest versions of webpack 5

juburr commented 1 year ago

My project also started spitting back 404 errors after upgrading to webpack 5. They were coming from unit tests utilizing axios-mock-adapter. I had to add the following lines to my dev mode webpack configuration to get it working:

optimization: {
    runtimeChunk: false,
    splitChunks: false
},

Karma-webpack works great with webpack v5 after that.