In my case, the problem was that webpack.config.js was missing this as the last line: module.exports = Encore.getWebpackConfig();