Search code examples
reactjswebpack-3

Uncaught TypeError: Cannot read property 'propTypes' of undefined when using NODE_ENV=production webpack -p


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?


Solution

  • 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.