You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
buildEnd is not a supported hook for emitFile, as far as webpack is concerned. The reason is because compilation is sealed before emit which is what buildEnd hooks. https://github.com/webpack/webpack/blob/f123ce5090e56ce1216debce487e8be25275b896/lib/Compiler.js#L1341
Thus you get TypeError: Cannot add property test.json, object is not extensible
So either emitFile isn't supported or buildEnd is using the wrong hook.
Environment
Node: v22.13.1
unplugin: 2.1.2
Reproduction
Describe the bug
Not sure if this is a bug or oversight but
unplugin/src/webpack/context.ts
Line 43 in c71bf55
buildEnd is not a supported hook for emitFile, as far as webpack is concerned. The reason is because compilation is sealed before emit which is what buildEnd hooks.
https://github.com/webpack/webpack/blob/f123ce5090e56ce1216debce487e8be25275b896/lib/Compiler.js#L1341
Thus you get
TypeError: Cannot add property test.json, object is not extensible
So either emitFile isn't supported or buildEnd is using the wrong hook.
Additional context
webpack/webpack#10876
The text was updated successfully, but these errors were encountered: