question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading to webpack 4 issue

See original GitHub issue

I’m getting the following when trying to build webpack 4:

TypeError: Cannot read property ‘tapAsync’ of undefined at /Users/user/react-boilerplate/node_modules/favicons-webpack-plugin/index.js:73:62

this is the code in index.js:73

if (!tapped++) {
   cmpp.hooks.htmlWebpackPluginBeforeHtmlProcessing.tapAsync(
       'favicons-webpack-plugin',
       addFaviconsToHtml
    );
}

any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Greg808commented, Sep 4, 2018

actually I used this plugin https://github.com/brunocodutra/webapp-webpack-plugin witch is a fork of your plugin and brunocodutra fixed it

1reaction
zeravciccommented, Aug 6, 2019

It seems that solution is to add mandatory html-webpack-plugin plugin! Yes?

Environment

  • JeffreyWay/laravel-mix v4.0.16
  • jantimon/html-webpack-plugin v3.2.0
  • jantimon/favicons-webpack-plugin v0.0.9 - commit [7845e4f20a54776555674ecc0537ca3d89aa2ccd]

Possible solution

This solution works for me (using Laravel Mix v4.0.16) Code:

const mix = require('laravel-mix')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FaviconsWebpackPlugin = require('favicons-webpack-plugin')

const htmlWebpackPlugin =  new HtmlWebpackPlugin();
const faviconsWebpackPlugin = new FaviconsWebpackPlugin({
    logo: path.join('path/to/my-logo.png'),
    prefix: 'path/to/favicons-[hash]/',
    emitStats: true,
    statsFilename: 'path/to/faviconstats.json',
});

/*
 |--------------------------------------------------------------------------
 | Webpack config
 |--------------------------------------------------------------------------
 */
mix.webpackConfig({
    plugins: [
        htmlWebpackPlugin,
        faviconsWebpackPlugin,
    ]
})

…and then of course - $ npm run production

I am waiting to hear some others experiences 😃 👍 👎

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v4 from v3 - webpack
If you are still using Node.js v4 or lower, you need to upgrade your Node.js installation to Node.js v6 or higher. Instructions for...
Read more >
Upgrading Webpack 4 → 5 | Square Corner Blog
Upgrading developer tools is usually not pressing, can be time consuming, and modifying a bundler can be high risk. Since we rely on...
Read more >
Step-by-step Guide to Upgrading to Webpack 4 - Oleg Chursin
Step-by-step Guide to Upgrading to Webpack 4 · 9. Fix any deprecation errors you may be getting. · 8. Update and reconfigure uglifyjs-webpack-plugin...
Read more >
Upgrade to Webpack 4 - DEV Community ‍ ‍
Upgrading your project from Webpack 3 to Webpack 4. ... I ran into a weird issue with webpack-hot-middleware but once I upgraded it...
Read more >
Just some notes about my attempt to upgrade to webpack 4
For loader options: webpack 2 no longer allows custom properties in configuration. Loaders should be updated to allow passing options via loader options...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found