-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Closed
Copy link
Labels
Has PRi: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Input Code
const path = require('path');
const {transformSync} = require('@babel/core');
transformSync('', {
filename: path.resolve('filename.js'),
plugins: [
() => ({
visitor: {
Program(path) {
throw path.buildCodeFrameError('example error');
}
}
})
]
});Expected behavior/code
The first line of error.message should be /path/to/filename.js: example error
Current Behavior
The first line of error.message is /path/to/filename.js: /path/to/filename.js: example error
Babel Configuration (.babelrc, package.json, cli command)
None / see code.
Environment
- Babel version(s): 7.6.3
- Node/npm version: node 8+
- OS: all
- Monorepo: no
- How you are using Babel: API
Possible Solution
Since packages/babel-core/src/transformation/index.js now prepends the error with the message maybe path.buildCodeFrameError should not do the same.
Additional context/Screenshots
Introduced by #10511. CC @JLHwung
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRi: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue