speed-measure-webpack-plugin icon indicating copy to clipboard operation
speed-measure-webpack-plugin copied to clipboard

Does it work with webpack 5?

Open tanekim88 opened this issue 5 years ago • 23 comments

I can't seem to make it work on webpack 5

tanekim88 avatar Oct 01 '20 07:10 tanekim88

It's the exception I encountered for future reference.

[webpack-cli] Promise rejection: TypeError: 'get' on proxy: property 'tapAsync' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '(options, fn) => {
                                                processAssetsHook.tapAsync(
                                                        getOptions(options),
                                                        (assets, callback) =>
        ...<omitted>... }' but got 'function () { [native code] }')
[webpack-cli] TypeError: 'get' on proxy: property 'tapAsync' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '(options, fn) => {
                                                processAssetsHook.tapAsync(
                                                        getOptions(options),
                                                        (assets, callback) =>
        ...<omitted>... }' but got 'function () { [native code] }')
    at Proxy.<anonymous> (/project/node_modules/copy-webpack-plugin/dist/index.js:340:42)
    at /speed-measure-webpack-plugin/WrappedPlugin/index.js:52:19
    at Hook.eval [as call] (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (/project/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/project/node_modules/webpack/lib/Compiler.js:918:30)
    at /project/node_modules/webpack/lib/Compiler.js:960:29
    at Hook.eval [as callAsync] (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/project/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/project/node_modules/webpack/lib/Compiler.js:955:28)
    at /project/node_modules/webpack/lib/Watching.js:113:19
    at _next0 (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:26:1)

jeiea avatar Oct 16 '20 01:10 jeiea

Got the same issue.

Deji69 avatar Oct 22 '20 23:10 Deji69

Got the same issue.

codeGun123 avatar Nov 02 '20 07:11 codeGun123

Got the same issue.

guoxiaomenghh avatar Nov 02 '20 09:11 guoxiaomenghh

Got the same issue.

luohuidong avatar Nov 11 '20 03:11 luohuidong

Got the same issue.

tianzhu1992 avatar Nov 23 '20 14:11 tianzhu1992

Got the same issue.

SunShinewyf avatar Nov 27 '20 03:11 SunShinewyf

Got the same issue.

yzStrive avatar Dec 17 '20 09:12 yzStrive

It still doesn't work on webpack 5.11.0

MyEasy avatar Dec 28 '20 02:12 MyEasy

Got the same issue.

donniean avatar Dec 28 '20 03:12 donniean

If you have the same issue, everybody, please just put a "thumbs-up" reaction on the original post, instead of replying "me too". This is important because everyone watching the issue for news will be notified every time you leave a comment.

thw0rted avatar Dec 28 '20 09:12 thw0rted

Tried the version in the PR to this issue but another error happened. This time is with html-webpack-plugin 5.0.0-beta.5.

[webpack-cli] TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE' of undefined
    at Proxy.<anonymous> (/var/app/web/node_modules/html-webpack-plugin/index.js:222:31)
    at /var/app/web/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:52:19
    at Hook.eval [as call] (eval at create (/var/app/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:52:1)
    at Hook.CALL_DELEGATE [as _call] (/var/app/web/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/var/app/web/node_modules/webpack/lib/Compiler.js:990:30)
    at /var/app/web/node_modules/webpack/lib/Compiler.js:1033:29
    at Hook.eval [as callAsync] (eval at create (/var/app/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/app/web/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/var/app/web/node_modules/webpack/lib/Compiler.js:1028:28)
    at /var/app/web/node_modules/webpack/lib/Compiler.js:471:12
    at Compiler.readRecords (/var/app/web/node_modules/webpack/lib/Compiler.js:869:11)
    at /var/app/web/node_modules/webpack/lib/Compiler.js:468:11
    at Hook.eval [as callAsync] (eval at create (/var/app/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/app/web/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at /var/app/web/node_modules/webpack/lib/Compiler.js:465:20
    at Hook.eval [as callAsync] (eval at create (/var/app/web/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
ERROR: 2

lephuongbg avatar Jan 21 '21 00:01 lephuongbg

[webpack-cli] TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_ADDITIONS' of undefined

takhello avatar Jan 25 '21 15:01 takhello

Same here with Webpack 5.20+ and SMP 1.4.2

(node:11916) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader

(node:11916) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE' of undefined at Proxy. (...node_modules\html-webpack-plugin\index.js:222:31) at ...node_modules\speed-measure-webpack-plugin\WrappedPlugin\index.js:52:19 at Hook.eval (eval at create (...node_modules\tapable\lib\HookCodeFactory.js:19:10), :48:1) at Compiler.newCompilation (...node_modules\webpack\lib\Compiler.js:992:30) at ...node_modules\webpack\lib\Compiler.js:1035:29 at Hook.eval [as callAsync] (eval at create (...node_modules\tapable\lib\HookCodeFactory.js:33:10), :22:1) at Compiler.compile (...node_modules\webpack\lib\Compiler.js:1030:28) at ...node_modules\webpack\lib\Watching.js:112:19 at _next2 (eval at create (...node_modules\tapable\lib\HookCodeFactory.js:33:10), :23:1) at eval (eval at create (...node_modules\tapable\lib\HookCodeFactory.js:33:10), :35:1)

RettentoRectangle avatar Feb 03 '21 15:02 RettentoRectangle

版本问题????

songjinzhou avatar Mar 23 '21 03:03 songjinzhou

Putting this here as I believe it to be webpack 5 related and I tried the mini-css fix of putting it to 1.35.

I get this error below:

Error: ObjectMiddleware.register: serializer for mini-css-extract-plugin/dist/CssModule/null is already registered ... at Object.register ... at Function.getCssModule ... at MiniCssExtractPlugin.apply

SamuelTrew avatar Mar 31 '21 17:03 SamuelTrew

@SamuelTrew - I get the exact same error. Did you find a solution?

perteraul avatar Apr 23 '21 18:04 perteraul

@SamuelTrew - I get the exact same error. Did you find a solution?

I ended up removing the @types/webpack dependency as it is apparently deprecated with webpack 5. That fixed it as I believe it was referring to old types

SamuelTrew avatar Apr 24 '21 12:04 SamuelTrew

@SamuelTrew I've got the same error as you, but I do not have @types/webpack dependency. Do you know if some nested dependency can cause it?


Checking my config file, i've been using the mini-css three times (to generate different filenames, to maintain retrocompatibility) and works fine without speed-measure. Maybe something related to that.

dhpagani avatar May 06 '21 11:05 dhpagani

Hi guys, I am writing a successor of this plugin: https://github.com/ShuiRuTian/time-analytics-webpack-plugin.

You could have a try with it. I believe it's providing a better experience for webpack 5.

It's in an early period(the API is not frozen and maybe buggy), but it's working for me.

Any feedback is welcomed!

ShuiRuTian avatar Nov 29 '22 09:11 ShuiRuTian

Working but getting this,

[DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader

"webpack": "^5.65.0", (apparently also on 5.75.0 still happening) "speed-measure-webpack-plugin": "^1.5.0",

webpack has deprecated that hook but speed measure plugin still referencing it.

Original https://github.com/stephencookdev/speed-measure-webpack-plugin/issues/123

kevinolivar avatar Jan 27 '23 14:01 kevinolivar