add-asset-html-webpack-plugin
add-asset-html-webpack-plugin copied to clipboard
[BUG] Cannot read property 'tapPromise' of undefined
I find it conflicts with speed-measure-webpack-plugin:
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;
me too
so how to fix it
Any update on the above issue?
是插件更新了,
是插件更新了,
怎么解决呢?
是插件更新了,
怎么解决呢?
卸载当前版本,装低版本,5的就可以了
我是用compression-webpack-plugin的时候出现的这个问题,和楼主一样的报错
所以是这个插件的问题,卸载了
npm uninstall compression-webpack-plugin
装个低版本的,比如6.1.1
npm i [email protected] -D
当前的最新版本是7.1.1,经过我的测试7.x的两个版本都不行
来个大佬翻译一下?
poor English
我是用compression-webpack-plugin的时候出现的这个问题,和楼主一样的报错 所以是这个插件的问题,卸载了
npm uninstall compression-webpack-plugin
装个低版本的,比如6.1.1npm 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 :))