stephencookdev / speed-measure-webpack-plugin

⏱ See how fast (or not) your plugins and loaders are, so you can optimise your builds
MIT License
2.42k stars 79 forks source link

Not working with Webpack 5: "TypeError: Cannot create proxy with a non-object as target or handler" #171

Closed facinick closed 3 years ago

facinick commented 3 years ago

I am facing performance issues with webpack 5 and happen to land on this issue#comment : https://github.com/webpack/webpack/issues/12102#issuecomment-738034631 where a guy used this plugin to compare webpack5 vs webpack4 speed. For some reason this plugin aint working with my webpack5, here is the error I'm getting:

[webpack-cli] TypeError: Cannot create proxy with a non-object as target or handler
    at new WrappedPlugin (/Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:280:12)
    at /Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/speed-measure-webpack-plugin/index.js:57:18
    at Array.map (<anonymous>)
    at SpeedMeasurePlugin.wrap (/Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/speed-measure-webpack-plugin/index.js:55:69)
    at module.exports (/Users/shriyans/Desktop/work/streaming-frontend-boilerplate/webpack/app.config.js:78:32)
    at /Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/webpack-cli/lib/webpack-cli.js:1391:43
    at Array.map (<anonymous>)
    at evaluateConfig (/Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/webpack-cli/lib/webpack-cli.js:1383:24)
    at /Users/shriyans/Desktop/work/streaming-frontend-boilerplate/node_modules/webpack-cli/lib/webpack-cli.js:1414:53
    at async Promise.all (index 0)
error Command failed with exit code 2.

Is it working in webpack 5 for anyone?

uwolfer commented 3 years ago

See https://github.com/stephencookdev/speed-measure-webpack-plugin/issues/170, removing '...' helps.