Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with some other webpack plugins #160

Open
someden opened this issue Feb 10, 2021 · 6 comments · Fixed by #163
Open

Incompatibility with some other webpack plugins #160

someden opened this issue Feb 10, 2021 · 6 comments · Fixed by #163

Comments

@someden
Copy link

someden commented Feb 10, 2021

I found some plugins that causes errors while use with speed-measure-webpack-plugin

Environment

"speed-measure-webpack-plugin": "1.4.2",
"webpack": "5.21.2",
"webpack-cli": "4.5.0",

Plugin: "terser-webpack-plugin": "5.1.1"

Simple config to reproduce:

const TerserPlugin = require('terser-webpack-plugin');
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const smp = new SpeedMeasurePlugin();

module.exports = smp.wrap({
  plugins: [new TerserPlugin()],
});
TypeError: Cannot read property 'JavascriptModulesPlugin' of undefined
  at Proxy.<anonymous> (/my-app/node_modules/terser-webpack-plugin/dist/index.js:572:49)
  at /my-app/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:52:19
  at _next25 (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:42:1)
  at _next3 (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:95:1)
  at Hook.eval [as call] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:105:1)
  at Hook.CALL_DELEGATE [as _call] (/my-app/node_modules/tapable/lib/Hook.js:14:14)
  at Compiler.newCompilation (/my-app/node_modules/webpack/lib/Compiler.js:993:26)
  at /my-app/node_modules/webpack/lib/Compiler.js:1035:29
  at Hook.eval [as callAsync] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
  at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/my-app/node_modules/tapable/lib/Hook.js:18:14)

Plugin: "compression-webpack-plugin": "7.1.2"

Simple config to reproduce:

const CompressionPlugin = require('compression-webpack-plugin');
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const smp = new SpeedMeasurePlugin();

module.exports = smp.wrap({
  plugins: [new CompressionPlugin()],
});
TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER' of undefined
  at Proxy.<anonymous> (/my-app/node_modules/compression-webpack-plugin/dist/index.js:285:45)
  at /my-app/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:52:19
  at Hook.eval [as call] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:5:1)
  at Hook.CALL_DELEGATE [as _call] (/my-app/node_modules/tapable/lib/Hook.js:14:14)
  at Compiler.newCompilation (/my-app/node_modules/webpack/lib/Compiler.js:992:30)
  at /my-app/node_modules/webpack/lib/Compiler.js:1035:29
  at Hook.eval [as callAsync] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
  at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/my-app/node_modules/tapable/lib/Hook.js:18:14)
  at Compiler.compile (/my-app/node_modules/webpack/lib/Compiler.js:1030:28)
  at /my-app/node_modules/webpack/lib/Compiler.js:473:12

Also I noticed similar problems in #155 and #149 with html-webpack-plugin, favicons-webpack-plugin, and copy-webpack-plugin

Could anybody explain, on what side we should fix it?
Here in speed-measure-webpack-plugin?
Or it's better to create issues in these plugins' repos and fix it there?

@lsbyerley
Copy link

lsbyerley commented Feb 19, 2021

Having the same issue with copy-webpack-plugin

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_ADDITIONS' of undefined

@rifler
Copy link

rifler commented Feb 27, 2021

[email protected] (1.3.6 was fine)

TypeError: Class extends value undefined is not a constructor or null

throws here:
https://github.com/webpack-contrib/mini-css-extract-plugin/blob/6ae4c3ede6b4d02c2c80234a6dc22c355c2e3855/src/index.js#L39

because webpack.Module is undefined

@monic-shixi
Copy link

Yep, same issue with [email protected] and [email protected].

@SimonAlling
Copy link

Same issue with [email protected]:

const HtmlWebpackPlugin = require("html-webpack-plugin")
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin")
const smp = new SpeedMeasurePlugin()

module.exports = smp.wrap({
  plugins: [
    new HtmlWebpackPlugin(),
  ],
})
(node:34911) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use `node --trace-deprecation ...` to show where the warning was created)
[webpack-cli] TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE' of undefined
    at Proxy.<anonymous> (/…/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), <anonymous>:25:1)
    at Hook.CALL_DELEGATE [as _call] (/…/node_modules/tapable/lib/Hook.js:14:14)
    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), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/…/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/…/node_modules/webpack/lib/Compiler.js:1030:28)
    at /…/node_modules/webpack/lib/Compiler.js:473:12

@SimonAlling
Copy link

And with [email protected]. The error is different though (PROCESS_ASSETS_STAGE_ADDITIONS instead of PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE):

(node:35340) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use `node --trace-deprecation ...` to show where the warning was created)
[webpack-cli] TypeError: Cannot read property 'PROCESS_ASSETS_STAGE_ADDITIONS' of undefined
    at Proxy.<anonymous> (/…/node_modules/favicons-webpack-plugin/src/index.js:249:30)
    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), <anonymous>:25:1)
    at Hook.CALL_DELEGATE [as _call] (/…/node_modules/tapable/lib/Hook.js:14:14)
    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), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/…/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/…/node_modules/webpack/lib/Compiler.js:1030:28)
    at /…/node_modules/webpack/lib/Compiler.js:473:12

@roryabraham
Copy link

We found that this plugin is incompatible with html-inline-script-webpack-plugin, but only when used with webpack-dev-server. I left some debug notes here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants