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

Tapable is deprecated in Webpack 4 #194

Open
FossPrime opened this issue Jun 28, 2018 · 4 comments
Open

Tapable is deprecated in Webpack 4 #194

FossPrime opened this issue Jun 28, 2018 · 4 comments

Comments

@FossPrime
Copy link

FossPrime commented Jun 28, 2018

webpack/webpack#6568 (comment)

Here's the trace with process.traceDeprecation = true a top of webpack.base.conf.js

(node:97338) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
    at Object.<anonymous> (/Volumes/git/x-web/build/dev-server.js:42:10)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
    at startup (internal/bootstrap/node.js:240:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)

Line 41+ of dev-server

// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
  compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
    hotMiddleware.publish({ action: 'reload' })
    cb()
  })
})

The solution seems to be compiler.hooks.done.tap('compilation', function (compilation) { though I'm really unsure about what any of this is for

@mikeerickson
Copy link

Was this ever cured somewhere else? I am having the same issue using the latest version so far as I can tell?

@FossPrime
Copy link
Author

My solution was to migrate to vue-cli, I have no idea what Webpack version it uses... but it's not longer our concern when using it. It wasn't as difficult as I predicted... the hardest part was setting computed env vars, but even that was relatively easy

@mikeerickson
Copy link

@rayfoss that is my typical first choice, however, I have a few existing apps that don’t use it and I have to “roll my own”.

To be quite honest, I am surprised this issue still exists?

@FossPrime
Copy link
Author

FossPrime commented Sep 4, 2018 via email

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

No branches or pull requests

2 participants