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

Webpack 4 and html-webpack-plugin 4 alpha #19

Open
quiasmo opened this issue Feb 27, 2018 · 5 comments · May be fixed by #22
Open

Webpack 4 and html-webpack-plugin 4 alpha #19

quiasmo opened this issue Feb 27, 2018 · 5 comments · May be fixed by #22

Comments

@quiasmo
Copy link

quiasmo commented Feb 27, 2018

So webpack 4 is out and there is an alpha version of the html-webpack-plugin
webpack-contrib/html-webpack-plugin

ERROR in   TypeError: cb is not a function

  - index.js:116 compilation.plugin
    [sierranevada-src]/[google-fonts-webpack-plugin]/src/index.js:116:5

  - new Promise

  - index.js:679
    [sierranevada-src]/[html-webpack-plugin]/index.js:679:45

  - index.js:141
    [sierranevada-src]/[html-webpack-plugin]/index.js:141:16

  - util.js:16 tryCatcher
    [sierranevada-src]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [sierranevada-src]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [sierranevada-src]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [sierranevada-src]/[bluebird]/js/release/promise.js:614:10

  - promise.js:693 Promise._settlePromises
    [sierranevada-src]/[bluebird]/js/release/promise.js:693:18

  - async.js:133 Async._drainQueue
    [sierranevada-src]/[bluebird]/js/release/async.js:133:16

  - async.js:143 Async._drainQueues
    [sierranevada-src]/[bluebird]/js/release/async.js:143:10

  - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [sierranevada-src]/[bluebird]/js/release/async.js:17:14

Apparently webpack4 has overhauled its plugin system
Any plan on patching this?

@matthew-matvei
Copy link

I believe I get a different error for the same reason:

drumstix@Communist-box:~/MEGA/Programming/Electron/freeman$ ./node_modules/.bin/webpack --config webpack.common.js
/home/drumstix/MEGA/Programming/Electron/freeman/node_modules/webpack/node_modules/tapable/lib/Tapable.js:63
                throw new Error(`Plugin could not be registered at '${name}'. Hook was not found.\n` +
                ^

Error: Plugin could not be registered at 'html-webpack-plugin-before-html-generation'. Hook was not found.
BREAKING CHANGE: There need to exist a hook at 'this.hooks'. To create a compatiblity layer for this hook, hook into 'this._pluginCompat'.
    at Compilation.plugin (/home/drumstix/MEGA/Programming/Electron/freeman/node_modules/webpack/node_modules/tapable/lib/Tapable.js:63:9)
    at Compilation.deprecated [as plugin] (internal/util.js:52:15)
    at compiler.plugin (/home/drumstix/MEGA/Programming/Electron/freeman/node_modules/google-fonts-webpack-plugin/src/index.js:108:16)
    at AsyncParallelHook.eval [as callAsync] (eval at create (/home/drumstix/MEGA/Programming/Electron/freeman/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:13:1)
    at AsyncParallelHook.lazyCompileHook [as _callAsync]
... [redacted for brevity's sake]

Looking at the stack trace, looks like Webpack now has a problem with this plugin.

@matthew-matvei
Copy link

Any response to this? When I migrate to webpack v4, if this is still holding the process back, I'll simply find other ways to get the fonts I'm using in my application. That would be a shame, given I like the value this plugin provides.

@meowsus
Copy link

meowsus commented Mar 23, 2018

@matthew-matvei are you using postcss in your project? postcss-font-magician boasts some wild features. Not sure if it's Webpack 4 compatible, but I noticed that one today while researching a bit.

@navelpluisje navelpluisje linked a pull request Mar 28, 2018 that will close this issue
@knuhol
Copy link

knuhol commented Mar 29, 2018

@navelpluisje thanks, #22 solves this!

@antony
Copy link

antony commented Aug 2, 2018

I'm assuming this project has been abandoned, so I've forked, merged this PR and published the module as @beyonk/google-fonts-webpack-plugin - also on github.

Please test and let me know your findings!

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.

5 participants