add-asset-html-webpack-plugin icon indicating copy to clipboard operation
add-asset-html-webpack-plugin copied to clipboard

[BUG] Cannot read property 'tapPromise' of undefined

Open tjx666 opened this issue 4 years ago • 9 comments

I find it conflicts with speed-measure-webpack-plugin:

screenshot_2020-03-09_14-50-55

When I remove speed-measure-webpack-plugin,no this error.

The project repository: coo; webpack.dev.ts:

import { resolve } from 'path';
import merge from 'webpack-merge';
import { HotModuleReplacementPlugin, NamedModulesPlugin, DllReferencePlugin } from 'webpack';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import AddAssetHtmlPlugin from 'add-asset-html-webpack-plugin';

import { PROJECT_ROOT } from '../constants';
import commonConfig from './webpack.common';

const devConfig = merge(commonConfig, {
    mode: 'development',
    devtool: 'eval-source-map',
    plugins: [
        new HotModuleReplacementPlugin(),
        new NamedModulesPlugin(),
        new ForkTsCheckerWebpackPlugin({
            memoryLimit: 1024,
            tsconfig: resolve(__dirname, '../../src/renderer/tsconfig.json'),
        }),
        new DllReferencePlugin({
            context: PROJECT_ROOT,
            manifest: resolve(PROJECT_ROOT, 'public/vendor/vendors-manifest.json'),
        }),
        new AddAssetHtmlPlugin({ filepath: resolve(PROJECT_ROOT, 'public/vendor/*.dll.js') }),
    ],
});

export default devConfig;

webpack.index.ts:

import { argv } from 'yargs';
import merge from 'webpack-merge';
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import SizePlugin from 'size-plugin';

import { __DEV__ } from '../constants';
import devConfig from './webpack.dev';
import prodConfig from './webpack.prod';

// eslint-disable-next-line import/no-mutable-exports
let webpackConfiguration = __DEV__ ? devConfig : prodConfig;
if (argv.analyze) {
    webpackConfiguration = merge(webpackConfiguration, {
        plugins: [new SizePlugin({ writeFile: false }), new BundleAnalyzerPlugin()],
    });
    const smp = new SpeedMeasurePlugin();
    webpackConfiguration = smp.wrap(webpackConfiguration);
}
export default webpackConfiguration;

tjx666 avatar Mar 09 '20 06:03 tjx666

me too

mayu888 avatar May 16 '20 14:05 mayu888

so how to fix it

Wangzongyao avatar Aug 26 '20 03:08 Wangzongyao

Any update on the above issue?

bsarun avatar Nov 04 '20 11:11 bsarun

是插件更新了,

zhangming27 avatar Dec 09 '20 00:12 zhangming27

是插件更新了,

怎么解决呢?

zhouguanglong avatar Dec 17 '20 08:12 zhouguanglong

是插件更新了,

怎么解决呢?

卸载当前版本,装低版本,5的就可以了

biluox avatar Dec 23 '20 09:12 biluox

我是用compression-webpack-plugin的时候出现的这个问题,和楼主一样的报错 所以是这个插件的问题,卸载了 npm uninstall compression-webpack-plugin 装个低版本的,比如6.1.1 npm i [email protected] -D 当前的最新版本是7.1.1,经过我的测试7.x的两个版本都不行 来个大佬翻译一下? poor English

ltxhhz avatar Dec 23 '20 14:12 ltxhhz

我是用compression-webpack-plugin的时候出现的这个问题,和楼主一样的报错 所以是这个插件的问题,卸载了 npm uninstall compression-webpack-plugin 装个低版本的,比如6.1.1 npm i [email protected] -D 当前的最新版本是7.1.1,经过我的测试7.x的两个版本都不行 来个大佬翻译一下? poor English

This problem occurred when I was using compression-webpack-plugin, the same error as the original poster So it's the problem with this plugin, uninstall it npm uninstall compression-webpack-plugin Install a lower version, such as 6.1.1 npm i [email protected] -D The current latest version is 7.1.1. After my test, the two versions of 7.x are not working Can someone translate it? .... (Google did not me :))

biruk-tesfaye avatar Dec 24 '20 12:12 biruk-tesfaye