-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks
instead
#879
Comments
I think this bug is caused by |
html-webpack-plugin seem to use the old plugin api in two places: https://github.com/jantimon/html-webpack-plugin/blob/master/index.js#L65 there should be a check like in other parts of that file (if (compiler.hooks) {compiler.hooks.emit.tap} else {compiler.plugin(...)} |
Duplicate of #874 |
Should be fixed in 3.0.5. |
Does fix deprecated warning, still doesn't load plugins in webpack 4. I've created #887 for that. |
@kagawagao thanks for the head up :) |
in the stack trace
I guess it should be new NodeTemplatePlugin(outputOptions).apply(childCompiler) |
Thanks @kagawagao - it's released in 3.0.6 |
I'm still getting the following warning in v3.0.6:
Edit: maybe it's coming from the html-webpack-include-assets-plugin module instead of this one? |
Yes, still I the issue exist with version 3.0.6 (node:93696) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
TypeError: cb is not a function
at Promise (eval at create (/xxx/node_modules/tapable/lib/HookCodeFactory.js:51:12), <anonymous>:11:16)
at new Promise (<anonymous>)
at AsyncSeriesWaterfallHook.eval [as promise] (eval at create (/xxx/node_modules/tapable/lib/HookCodeFactory.js:51:12), <anonymous>:4:8)
at AsyncSeriesWaterfallHook.lazyCompileHook [as _promise] (/xxx/node_modules/tapable/lib/Hook.js:35:21)
at /xxx/node_modules/html-webpack-plugin/index.js:647:47
at Promise.resolve.then.then.then.then.then.then.then.then.catch.then.then (/xxx/node_modules/html-webpack-plugin/index.js:211:21)
at <anonymous> |
@theodorejb @alhazmy13 You may find out where the root cause is by setting @alhazmy13 BTW, I noticed you're using compiler.hooks.compilation.tap('dev-runner', compilation => {
compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('dev-runner', (data, cb) => {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})) FYI, there're several lines of code need to be revised as well. |
@qazbnm456 Thanks for your support, solved with your code. |
@jantimon I dont't think it has been fixed. In version 3.2.0, same error is showed. |
@gaterking please create a new issue with a minimal reproduction example |
@jantimon compiler.hooks.compilation.tap('html-webpack-plugin-after-emit', () => {
hotMiddleware.publish({
action: 'reload'
});
}); In webpack 3 code: compiler.plugin('compilation', (compilation) => {
compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => {
hotMiddleware.publish({
action: 'reload'
});
// cb();
});
}); |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Error Message & Stack Trace
Config
Html template file:
Environment
The text was updated successfully, but these errors were encountered: