Closed Jack-Works closed 2 years ago
does the workaround work for you?
Disabling the eagerChunkLoading
option works for me, though I'd like to resolve this properly. I'm looking into contributing a fix, though I'm not fully familiar with Webpack plugin development.
The way I understand the issue is that when eager chunk loading and Manifest V3 is enabled, a runtime module is added to load chunks eagerly which requires RuntimeGlobals.ensureChunk
, but this runtime requirement is not declared so that the runtime module that installs RuntimeGlobals.ensureChunk
is not necessarily added. Adding a dynamic import has the side effect of adding a runtime requirement on RuntimeGlobals.ensureChunk
, which is why it works as a workaround.
Would the solution be to, in addition to adding EagerlyLoadChunksRuntimeModule
to the background entry chunk, tapping Compilation.hooks.additionalTreeRuntimeRequirements
and adding RuntimeGlobals.ensureChunk
to runtimeRequirements
on the background entry chunk, or is there a fancier method to add a runtime requirement?
hi @crimx can u release a new version?
Sure. webpack-target-webextension@1.0.4 publish. @Jack-Works feel free to publish new versions as you already had write access to the package. 🚀
Temporary workaround: Adding a dynamic import in your source code
I should add
.e
to the dependency but I don't have the resources to do that. PR welcome.