-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Build Failure when babel-traverse@6.21.0 #5012
Comments
Do you have a minimal code snippet for this? The input code section is blank. Looks like it's from #4940 though @appden if (!path.parentPath ||
(Array.isArray(path.container) && path.isStatement()) ||
(path.isVariableDeclarator() && path.parentPath.node.declarations.length > 1)) for some reason path.parentPath.node is |
@hzoo I added example code. |
Awesome. you should also have |
@hzoo ooops, my mistake. I updated the babelrc section. |
I gotta go to sleep 😴, maybe you can pin to previous babel-traverse. Actual workaround is to add a minimal code snippet so far is: class AnchorLink extends Component {
render() {
const { isExternal, children, isClosed } = this.props;
if (isExternal) {
if (isClosed) {
return (<p>{children}</p>);
}
return (<a>{children}</a>);
}
return (<Link>{children}</Link>);
}
} config has to use es2015-node4 (works with es2015) {
"presets": [
"react",
"es2015-node4"
],
"plugins": [
"transform-react-constant-elements",
"transform-react-inline-elements"
]
}, |
Haven't looked at es2015-node4 (never heard of it). Not necessarily related but I would recommend using https://github.com/babel/babel-preset-env. Not sure why you need es2015-node4 if its react + a client side app
seems to work |
Thank you. I will try. |
Even more minimal repro: class AnchorLink extends Component {
render() {
const { isExternal, children } = this.props;
if (isExternal) {
return (<a>{children}</a>);
}
return (<Link>{children}</Link>);
}
} {
"plugins": [
"syntax-jsx",
"transform-es2015-destructuring",
"transform-react-constant-elements"
]
} Will try to dig a bit more later today. |
I have a similar error but in a different place:
So the problem is at https://github.com/babel/babel/blob/master/packages/babel-traverse/src/scope/index.js#L783 I added a console log at that location, and it is related to tagged template literals; the value of declarPath is too large to list, and the declarator is
|
Ah, when I disable |
Any updates on this one? First was getting it and had to downgrade to
(not using babili) |
@ilionic if you rollback a direct dependency it doesn't mean it will rollback its dependencies. For example, If you take a look at You can easily check the I'm using |
Sorry forgot about this one in the last release all, will do a patch. Can temp remove the constant-elements plugin as a workaround (there are some other existing bugs we need to solve still) |
Ok released |
thanks @hzoo |
We have got a following babel-traverse exception.
We don't know the workaround and the solution of this problem.
Input Code
Babel Configuration (.babelrc, package.json, cli command)
Expected Behavior
build success.
Current Behavior
build failure
Possible Solution
N/A
Context
Your Environment
The text was updated successfully, but these errors were encountered: