In 0.14.6, I ran into the following error when updating in a project:
Cannot read property 'referencePaths' of undefined at
VariableDeclarator, lib/index.js:292:56
I have so far been unable to reproduce this in our test suite, but I can
reproduce it in a local repo by using npm link. I wonder if this could
be a weird interaction of multiple babel plugins.
It seems that in the case I am encountering, the VariableDeclarator has
an id of type ObjectPattern, which means that there is some object
destructuring happening.
We should ideally take care to clean up the destructuring in the same
way that we clean up other variable usage, but I think that will be a
little more complicated than what I have time for right now, so as a
quick fix, I am escaping from this function in this case.
In my local testing, this prevents the plugin from crashing and produces
the same result as before.
In 0.14.6, I ran into the following error when updating in a project:
I have so far been unable to reproduce this in our test suite, but I can reproduce it in a local repo by using
npm link
. I wonder if this could be a weird interaction of multiple babel plugins.It seems that in the case I am encountering, the VariableDeclarator has an id of type ObjectPattern, which means that there is some object destructuring happening.
We should ideally take care to clean up the destructuring in the same way that we clean up other variable usage, but I think that will be a little more complicated than what I have time for right now, so as a quick fix, I am escaping from this function in this case.
In my local testing, this prevents the plugin from crashing and produces the same result as before.
Fixes #160