<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const path = require('path');
const {transformSync} = require('@babel/core');

transformSync('', {
	filename: path.resolve('filename.js'),
	plugins: [
		() =&gt; ({
			visitor: {
				Program(path) {
					throw path.buildCodeFrameError('example error');
				}
			}
		})
	]
});"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span>transformSync<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/core'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-en">transformSync</span><span class="pl-kos">(</span><span class="pl-s">''</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
	<span class="pl-c1">filename</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'filename.js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
	<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
		<span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>
			<span class="pl-c1">visitor</span>: <span class="pl-kos">{</span>
				<span class="pl-en">Program</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
					<span class="pl-k">throw</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">buildCodeFrameError</span><span class="pl-kos">(</span><span class="pl-s">'example error'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				<span class="pl-kos">}</span>
			<span class="pl-kos">}</span>
		<span class="pl-kos">}</span><span class="pl-kos">)</span>
	<span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
The first line of error.message should be <code class="notranslate">/path/to/filename.js: example error</code></p>
<p dir="auto"><strong>Current Behavior</strong><br>
The first line of error.message is <code class="notranslate">/path/to/filename.js: /path/to/filename.js: example error</code></p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">None / see code.</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.6.3</li>
<li>Node/npm version: node 8+</li>
<li>OS: all</li>
<li>Monorepo: no</li>
<li>How you are using Babel: API</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
Since packages/babel-core/src/transformation/index.js now prepends the error with the message maybe <code class="notranslate">path.buildCodeFrameError</code> should not do the same.</p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
Introduced by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="500519854" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10511" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10511/hovercard" href="https://github.com/babel/babel/pull/10511">#10511</a>.  CC <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JLHwung/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JLHwung">@JLHwung</a></p>
<h2 dir="auto">Bug Report</h2>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I would like to work on a fix!</li>
</ul>

<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto"><a href="https://unpkg.com/@babel/runtime@7.13.2/helpers/createSuper/_index.mjs" rel="nofollow">https://unpkg.com/@babel/runtime@7.13.2/helpers/createSuper/_index.mjs</a></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import getPrototypeOf from &quot;@babel/runtime/helpers/getPrototypeOf&quot;;
import isNativeReflectConstruct from &quot;@babel/runtime/helpers/isNativeReflectConstruct&quot;;
import possibleConstructorReturn from &quot;@babel/runtime/helpers/possibleConstructorReturn&quot;;
export default function _createSuper(Derived) {
  var hasNativeReflectConstruct = isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return possibleConstructorReturn(this, result);
  };
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">getPrototypeOf</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/getPrototypeOf"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">isNativeReflectConstruct</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/isNativeReflectConstruct"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">possibleConstructorReturn</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/possibleConstructorReturn"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-en">_createSuper</span><span class="pl-kos">(</span><span class="pl-v">Derived</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">var</span> <span class="pl-s1">hasNativeReflectConstruct</span> <span class="pl-c1">=</span> <span class="pl-en">isNativeReflectConstruct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-en">_createSuperInternal</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-v">Super</span> <span class="pl-c1">=</span> <span class="pl-en">getPrototypeOf</span><span class="pl-kos">(</span><span class="pl-v">Derived</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-s1">result</span><span class="pl-kos">;</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">hasNativeReflectConstruct</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">var</span> <span class="pl-v">NewTarget</span> <span class="pl-c1">=</span> <span class="pl-en">getPrototypeOf</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span><span class="pl-kos">;</span>
      <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-v">Super</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</span><span class="pl-kos">,</span> <span class="pl-v">NewTarget</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
      <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-v">Super</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">return</span> <span class="pl-en">possibleConstructorReturn</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-s1">result</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Should it be?</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="```js
- import getPrototypeOf from &quot;@babel/runtime/helpers/getPrototypeOf&quot;;
- import isNativeReflectConstruct from &quot;@babel/runtime/helpers/isNativeReflectConstruct&quot;;
- import possibleConstructorReturn from &quot;@babel/runtime/helpers/possibleConstructorReturn&quot;;
+ import getPrototypeOf from &quot;@babel/runtime/helpers/esm/getPrototypeOf&quot;;
+ import isNativeReflectConstruct from &quot;@babel/runtime/helpers/esm/isNativeReflectConstruct&quot;;
+ import possibleConstructorReturn from &quot;@babel/runtime/helpers/esm/possibleConstructorReturn&quot;;
export default function _createSuper(Derived) {
  var hasNativeReflectConstruct = isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return possibleConstructorReturn(this, result);
  };
}"><pre class="notranslate">```js
<span class="pl-md"><span class="pl-md">-</span> import getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";</span>
<span class="pl-md"><span class="pl-md">-</span> import isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";</span>
<span class="pl-md"><span class="pl-md">-</span> import possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> import getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> import isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> import possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";</span>
export default function _createSuper(Derived) {
  var hasNativeReflectConstruct = isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return possibleConstructorReturn(this, result);
  };
}</pre></div>
<p dir="auto">like: <a href="https://unpkg.com/browse/@babel/runtime@7.12.0/helpers/esm/createSuper.js" rel="nofollow">https://unpkg.com/browse/@babel/runtime@7.12.0/helpers/esm/createSuper.js</a></p>
<p dir="auto"><strong>Environment</strong></p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  System:
    OS: macOS 10.15.7
  Binaries:
    Node: 15.3.0 - ~/.nvm/versions/node/v15.3.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.3.0/bin/yarn
    npm: 7.0.14 - ~/.nvm/versions/node/v15.3.0/bin/npm
  npmPackages:
    @babel/runtime: ^7.12.5 =&gt; 7.13.2 
    babel-plugin-add-react-displayname: ^0.0.5 =&gt; 0.0.5 
    eslint: ^7.9.0 =&gt; 7.20.0 
    eslint-plugin-babel: ^5.3.0 =&gt; 5.3.1 
    jest: ^26.0.0 =&gt; 26.6.3 "><pre class="notranslate"><code class="notranslate">  System:
    OS: macOS 10.15.7
  Binaries:
    Node: 15.3.0 - ~/.nvm/versions/node/v15.3.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.3.0/bin/yarn
    npm: 7.0.14 - ~/.nvm/versions/node/v15.3.0/bin/npm
  npmPackages:
    @babel/runtime: ^7.12.5 =&gt; 7.13.2 
    babel-plugin-add-react-displayname: ^0.0.5 =&gt; 0.0.5 
    eslint: ^7.9.0 =&gt; 7.20.0 
    eslint-plugin-babel: ^5.3.0 =&gt; 5.3.1 
    jest: ^26.0.0 =&gt; 26.6.3 
</code></pre></div>
<ul dir="auto">
<li>Babel version(s): 7.13.3</li>
<li>Node/npm version: 15.3.0</li>
<li>OS: [e.g. macOS 10.15.4, Windows 10]</li>
<li>Monorepo: [e.g. yes/no/Lerna]</li>
<li>How you are using Babel: [e.g. <code class="notranslate">webpack</code>, <code class="notranslate">rollup</code>, <code class="notranslate">parcel</code>, <code class="notranslate">babel-register</code>]</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context</strong></p>