c.f. https://github.com/webpack/webpack/issues/13801
via @roninjin10:
Here is my investigation into this issue that lead to helping produce the minimal example:
If using contenthash with a WebWorker and any plugin is calling Maintemplate.prototype.hook.localVars such as the webpack-subresource-integrity plugin, the runtime starts requesting for undefined when it tries to load the web worker chunk both observed in the console and from adding logging in webpacks source .
Since this is happening as a sideeffect of calling .tap, I think the issue lies downstream of
mainTemplate.hooks.localVars.isUsed() ||but I'm not sure.