Webpack 5 Deprecation Warnings: DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET

When I build my application, I see webpack warnings like:

Bundling ./src/routes.ts and xdn.config.js... (node:88756) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(node:88756) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
(node:88756) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.

What causes those?

This likely means that one of the webpack plugins used by your app was written for webpack < 5. A common culprit seems to be ts-loader. To find where it is in your dependency try, you can run:

npm ls ts-loader

We ran into this on the XDN development team when we forgot to upgrade ts-loader in @xdn/core before upgrading to webpack 5.