1

我刚刚在一个项目上安装了 react-pdf,但应用程序崩溃并出现以下错误。我在这里错过了什么吗?还是我需要对 webpack 进行任何配置更改?谢谢

 TypeError: Cannot read property 'addFileToAssets' of undefined

  - addAllAssetsToCompilation.js:67 
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:67:55

  - Generator.next

  - addAllAssetsToCompilation.js:101 step
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:101:807

  - addAllAssetsToCompilation.js:101 
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:101:1037

  - new Promise

  - addAllAssetsToCompilation.js:101 
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:101:718

  - addAllAssetsToCompilation.js:98 addFileToAssets
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:98:66

  - addAllAssetsToCompilation.js:105 
    [thinking-nation-web]/[add-asset-html-webpack-plugin]/lib/addAllAssetsToCompilation.js:105:11

  - index.js:4 pReduce
    [thinking-nation-web]/[p-each-series]/index.js:4:73

  - index.js:16 Promise.all.then.value
    [thinking-nation-web]/[p-reduce]/index.js:16:10

Html Webpack Plugin:
4

1 回答 1

1

版本"add-asset-html-webpack-plugin": "^3.0.0"- 为我解决了这个问题。您也可以检查DllReferencePluginHtmlWebpackPlugin放置在此插件之前

于 2018-08-13T01:14:32.410 回答