React-pdf: Webpack plugin error on React-PDF installation

Created on 29 Jul 2018  路  5Comments  路  Source: wojtekmaj/react-pdf

I just installed react-pdf on a project, but the app crashes with the below error. Am I missing something here? Or do I need any config changes to webpack? Thanks

```
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:

```

invalid

Most helpful comment

Same here, only when installing react-pdf and importing Document and page with webworker.

Resolved by upgrading add-asset-html-webpack-plugin": "^3.0.0"

All 5 comments

Hello,
no, there shouldn't be any changes to your config unless it's a very exotic one. I don't know the plugin you're using though.

This seems like a Webpack or Webpack plugin issue. There's no mention of React-PDF in it. I think the authors of this plugin would appreciate the report.

Also, which Webpack version do you use?

I'm closing this as there's nothing we can do on our side with no more info. Please contact Webpack plugin authors.

Hello, did you solved this issue? I have the same

This is not the correct repository to report this error on. add-asset-html-webpack-plugin is what's crashing. You can report it and mention this issue while creating it.

Same here, only when installing react-pdf and importing Document and page with webworker.

Resolved by upgrading add-asset-html-webpack-plugin": "^3.0.0"

Was this page helpful?
0 / 5 - 0 ratings