-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transformation issue with es2015 #17
Comments
@jquense You pointed this out a while ago in Slack. I'm confused why this is happening... they're both using babel-plugin-dev-expression/dev-expression.js Lines 79 to 88 in c734a08
|
It might be that it just messes with the scope/binding info enough that it doesn't connect them anymore. Or maybe it tracks through the callExpression, not the callee? |
Did anyone find a solution to this, I'm hitting the same issue: This:
Results in:
Where |
Bit more digging, and this seems to be caused by using @babel/preset-env - so I'm not sure it's a bug with this plugin |
The plugin reuses Duplicate AST nodes cause nasty issues like this, as a plugin author, you can use babel-check-duplicated-nodes to ensure the transformed AST does not contain duplicate nodes. Babel uses it, too. |
I noticed that my
commonjs
build included the incorrectly transformedinvariant(false)
.This is incorrect as the
import
is being transformed tovar _invariant
andinvariant
isn't defined.The issue can be reproduced in babel repl.
Not sure if
invariant(false)
can be converted to(0, _invariant.default)(false)
or whatever.The text was updated successfully, but these errors were encountered: