<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" checked=""> I would like to work on a fix!</li>
</ul>
<p dir="auto"><strong>Current behavior</strong><br>
A clear and concise description of the behavior.</p>
<p dir="auto"><code class="notranslate">generate()</code> produces incorrect code for arrow function expression.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const generate = require('@babel/generator').default;
const node = t.arrowFunctionExpression( [], t.objectExpression( [] ) );
console.log( generate( node ) );"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">generate</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/generator'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">node</span> <span class="pl-c1">=</span> <span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">arrowFunctionExpression</span><span class="pl-kos">(</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">objectExpression</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span> <span class="pl-s1">generate</span><span class="pl-kos">(</span> <span class="pl-s1">node</span> <span class="pl-kos">)</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="() =&gt; {}"><pre class="notranslate"><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></pre></div>
<p dir="auto">Output should be:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="() =&gt; ({})"><pre class="notranslate"><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-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)</strong></p>
<p dir="auto">No config used. The above is the complete reproduction case.</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 Mojave 10.14.6
Binaries:
	Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node
	npm: 6.14.8 - ~/.nvm/versions/node/v14.9.0/bin/npm
npmPackages:
	@babel/core: ^7.11.6 =&gt; 7.11.6 
	@babel/generator: ^7.11.6 =&gt; 7.11.6 
	@babel/helper-module-transforms: ^7.11.0 =&gt; 7.11.0 
	@babel/parser: ^7.11.5 =&gt; 7.11.5 
	@babel/plugin-transform-modules-commonjs: ^7.10.4 =&gt; 7.10.4 
	@babel/plugin-transform-react-jsx: ^7.10.4 =&gt; 7.10.4 
	@babel/register: ^7.11.5 =&gt; 7.11.5 
	@babel/traverse: ^7.11.5 =&gt; 7.11.5 
	@babel/types: ^7.11.5 =&gt; 7.11.5 
	babel-jest: ^26.3.0 =&gt; 26.3.0 
	babel-plugin-dynamic-import-node: ^2.3.3 =&gt; 2.3.3 
	eslint: ^7.8.1 =&gt; 7.8.1 
	jest: ^26.4.2 =&gt; 26.4.2"><pre class="notranslate"><code class="notranslate">System:
	OS: macOS Mojave 10.14.6
Binaries:
	Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node
	npm: 6.14.8 - ~/.nvm/versions/node/v14.9.0/bin/npm
npmPackages:
	@babel/core: ^7.11.6 =&gt; 7.11.6 
	@babel/generator: ^7.11.6 =&gt; 7.11.6 
	@babel/helper-module-transforms: ^7.11.0 =&gt; 7.11.0 
	@babel/parser: ^7.11.5 =&gt; 7.11.5 
	@babel/plugin-transform-modules-commonjs: ^7.10.4 =&gt; 7.10.4 
	@babel/plugin-transform-react-jsx: ^7.10.4 =&gt; 7.10.4 
	@babel/register: ^7.11.5 =&gt; 7.11.5 
	@babel/traverse: ^7.11.5 =&gt; 7.11.5 
	@babel/types: ^7.11.5 =&gt; 7.11.5 
	babel-jest: ^26.3.0 =&gt; 26.3.0 
	babel-plugin-dynamic-import-node: ^2.3.3 =&gt; 2.3.3 
	eslint: ^7.8.1 =&gt; 7.8.1 
	jest: ^26.4.2 =&gt; 26.4.2
</code></pre></div>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/also/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/also">@also</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.2.0</li>
<li><strong>Node version:</strong> 4.1.2</li>
<li><strong>npm version:</strong> 3.4.1</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="none"><pre class="notranslate"><code class="notranslate">none
</code></pre></div>
<h3 dir="auto">Input code</h3>
<p dir="auto">Dependencies in package.json:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;dependencies&quot;: {
    &quot;babel-runtime&quot;: &quot;6.2.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;babel-cli&quot;: &quot;6.2.0&quot;,
    &quot;babel-plugin-transform-runtime&quot;: &quot;6.1.18&quot;,
    &quot;babel-preset-es2015&quot;: &quot;6.1.18&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "dependencies": {
    "babel-runtime": "6.2.0"
  },
  "devDependencies": {
    "babel-cli": "6.2.0",
    "babel-plugin-transform-runtime": "6.1.18",
    "babel-preset-es2015": "6.1.18"
  }
}
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">I have a relatively simple <code class="notranslate">package.json</code> (<a href="https://github.com/also/babel-6-runtime-test/blob/ca958aa2f5881a0590a97f7a4216cd4be89dc4cc/package.json">here</a>).</p>
<p dir="auto">Using npm 3.4 and Node.js 4.1, <code class="notranslate">babel-doctor</code> complains about 43 duplicate <code class="notranslate">babel-runtime</code> packages, even after running <code class="notranslate">npm dedupe</code>.</p>
<p dir="auto"><a href="https://travis-ci.org/also/babel-6-runtime-test/builds/92763739" rel="nofollow">Output from Travis CI</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ babel-doctor

Babel Doctor
Running sanity checks on your system. This may take a few minutes...

✔ Found config at /home/travis/build/also/babel-6-runtime-test/.babelrc

✖ Found these duplicate packages:

- babel-runtime x 43

Recommend running `npm dedupe`

✔ All babel packages appear to be up to date
✔ You're on npm &gt;=3.3.0

Found potential issues on your machine :("><pre class="notranslate"><code class="notranslate">$ babel-doctor

Babel Doctor
Running sanity checks on your system. This may take a few minutes...

✔ Found config at /home/travis/build/also/babel-6-runtime-test/.babelrc

✖ Found these duplicate packages:

- babel-runtime x 43

Recommend running `npm dedupe`

✔ All babel packages appear to be up to date
✔ You're on npm &gt;=3.3.0

Found potential issues on your machine :(
</code></pre></div>
<p dir="auto">It seems that it is possible to work around the issue by switching to the version of <code class="notranslate">babel-runtime</code> being duplicated, currently <code class="notranslate">5.8.34</code>.</p>