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
TypeError: Cannot read property 'buildError' of undefined #8689
Comments
Hey @yiye! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
This may be a duplicate, but it's hard to tell without a full reproduction example. What config and input source are you using to produce this error? How are you calling Babel? It would be great if you could provide a repository that reproduces the error. |
I'm getting the same thing where hub isn't defined. let code = `
function foo(v) {
let v = 8
}
`;
let ast = parse(code, {
sourceType: 'module',
sourceFilename: 'failingTest',
ranges: true,
plugins: [
'jsx',
'flow',
'classProperties',
'objectRestSpread'
]
})
traverse(ast, {
Program(path) {
console.log('here')
}
}, null, { stateData: {} }); |
ya this looks like a duplicate of #8262 , although I don't t think it needs to be typescript. |
Cool, this is actually a duplicate of #8617. That other one is triggering the same broken code, but that other one isn't supposed to trigger an error in the first place. |
And to clarify, #8617 is what is causing your code snippet to throw an unhelpful error message, but your example code is a valid error, just to clarify, in case you wanted it to not throw. |
ya I believe they all have the same cause. Looks like hub isn't initialized in our case in the root path so when context.create tries to grab it recursively from the parentPath, nothing's there. I've gotten the error here and the one in 8262 for the same reason, but with slightly different test code. |
Yup, I mostly clarify because for #8262 it is different because it actually shouldn't be a "Duplicate declaration" in the first place. |
Bug Report
Current Behavior
A clear and concise description of the behavior.
Input Code
Environment
AST parser
].
The text was updated successfully, but these errors were encountered: