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
path.buildCodeFrameError('Error')
throws
#8617
Comments
Hey @pasaran! 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 |
Strange, I'd expect it to have that function from babel/packages/babel-traverse/src/hub.js Line 19 in 59e9c63
this.hub somewhere.
|
@loganfsmyth It doesn't have that, because |
It looks like I probably pasted the wrong link when I posted that, woops. |
@loganfsmyth I'm running into this right now - where were you intending to link to? |
I honestly think at the moment we just don't ever set a default Depending on your usecase for |
When I |
Sorry, I don't quite follow what you're using |
TODO: This still does not work correctly because of babel/babel#8617 Must use @babel/core.traverse instead.
Hub. buildError node parameter is not used I solved with const code = require( '@babel/generator' ).default( path.node , {} ).code
throw new Error( `\n${code}\n ^^^^ your message` ) |
Some version of this issue seems to have been reintroduced by #10914 in 7.8.0. Before 7.8.0, Since 7.8.0, |
Yeah I'm still seeing this error when using Update: Installing older versions of |
Bug Report
Current Behavior
path.buildCodeFrameError( 'Some error' )
throws error:Input Code
Expected behavior/code
throw path.buildCodeFrameError( ERROR )
should do the same asthrow codeFrameColumns( CODE, path.node.loc, ERROR );
(I guess).Babel Configuration (.babelrc, package.json, cli command)
Environment
cli
The text was updated successfully, but these errors were encountered: