0

I need help with webpack, version 3 and react, i've updated a package to a newer version and when i build it with NODE_ENV=production webpack -p it throws the Uncaught TypeError: Cannot read property 'propTypes' of undefined error but loads fine with just webpack -p, how do I debug why that is the case? What's difference between the two, is the minifcation cause the issue?

Arun Ghosh
  • 7,634
  • 1
  • 26
  • 38
Beto
  • 772
  • 2
  • 12
  • 26
  • Can you share the code were the error happens? – Arun Ghosh Aug 31 '18 at 06:04
  • I can't post the code to the error, but i'm updating the dependency on the main project, where the issue is happening and an old version is a dependency of a another depenecy as well, so there might be, i'm not sure, a conflict of the old and the new, maybe there is a way to have one use the old and the other use the new, but i don't know how to do that in webpack, it just seems all turn to gibbrish once it's run through: new webpack.optimize.UglifyJsPlugin({ mangle: true, }), new webpack.optimize.ModuleConcatenationPlugin(), – Beto Aug 31 '18 at 19:56
  • Ok after digging around, i found a solution but am unsure as to why it works. The solution is to remove optimize.ModuleConcatenationPlugin(), while every tutorial says this will make my code faster, does anyone know if there is an alternative to this? – Beto Aug 31 '18 at 22:17

1 Answers1

0

Ok after digging around, i found a solution but am unsure as to why it works. The solution is to remove optimize.ModuleConcatenationPlugin(), while every tutorial says this will make my code faster, does anyone know if there is an alternative to this, please post it here.

Beto
  • 772
  • 2
  • 12
  • 26