oliviertassinari / babel-plugin-transform-react-remove-prop-types

Remove unnecessary React propTypes from the production build. :balloon:
MIT License
897 stars 61 forks source link

0.4.16 bug: Cannot read property 'referencePaths' of undefined at VariableDeclarator, lib/index.js:292:56 #160

Closed lencioni closed 6 years ago

lencioni commented 6 years ago

I haven't had time to dig in yet, but noticed this when updating from 0.4.15 to 0.4.16 in a repo.

adammiller commented 6 years ago

Seeing the same with a line like this: PropTypes.oneOf(["Icon", "Button"]).isRequired. If i remove that line, the error goes away.

lencioni commented 6 years ago

I haven't been able to reproduce this in the test suite, so I think it might be an interaction of multiple babel plugins. I can put up a PR that avoids this, but I am not sure what the cause is yet.

lencioni commented 6 years ago

@adammiller In my local testing, #161 prevents this crash. Can you try this out locally for me?

maturanomx commented 6 years ago

Just when I modify my dependencies, new release with the fix! 😆

Awesome work!. I will try this new version. Let you know any problem 👍

lencioni commented 6 years ago

I found another problem, with ArrayPattern. Getting a fix ready now.

lencioni commented 6 years ago

@maturanomx I published 0.4.18 with some more fixes. Please let me know if you run into any more issues!