<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/xfix/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/xfix">@xfix</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.2.1</li>
<li><strong>Node version:</strong> 5.1.0</li>
<li><strong>npm version:</strong> 3.5.0</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--presets es2015"><pre class="notranslate"><code class="notranslate">--presets es2015
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let results = []

for (let i = 0; i &lt; 3; i++) {
  switch ('x') {
    case 'x':
      const x = i
      results.push(() =&gt; x)
  }
}

for (const result of results) {
  console.log(result())
}"><pre class="notranslate"><code class="notranslate">let results = []

for (let i = 0; i &lt; 3; i++) {
  switch ('x') {
    case 'x':
      const x = i
      results.push(() =&gt; x)
  }
}

for (const result of results) {
  console.log(result())
}
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">When I declare a block scoped variable in a switch block, it's not recognized as a block scoped variable for purpose of functions, even when it's declared inside a for loop. This example prints 2, 2, 2, when it should print 0, 1, 2.</p>
<p dir="auto">(I outright apologize if this is a duplicate, finding duplicates with that bug tracker is annoying)</p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
I am getting following error. Can't figure out solution. I found many post which looks duplicate here but, nothing work.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules@babel\helper-plugin-utils\lib\index.js

throw Object.assign(err, {

Error: Requires Babel &quot;^7.0.0-0&quot;, but was loaded with &quot;6.26.3&quot;. If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention &quot;@babel/core&quot; or &quot;babel-core&quot; to see what is calling Babel.
"><pre class="notranslate"><code class="notranslate">node_modules@babel\helper-plugin-utils\lib\index.js

throw Object.assign(err, {

Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.

</code></pre></div>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: {
    &quot;express&quot;: &quot;^4.16.4&quot;,
    &quot;isomorphic-fetch&quot;: &quot;^2.2.1&quot;,
    &quot;react&quot;: &quot;^16.6.3&quot;,
    &quot;react-dom&quot;: &quot;^16.6.3&quot;,
    &quot;react-redux&quot;: &quot;^5.1.1&quot;,
    &quot;react-router&quot;: &quot;^4.3.1&quot;,
    &quot;react-router-config&quot;: &quot;^1.0.0-beta.4&quot;,
    &quot;react-router-dom&quot;: &quot;^4.3.1&quot;,
    &quot;redux&quot;: &quot;^4.0.1&quot;,
    &quot;redux-thunk&quot;: &quot;^2.3.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@babel/cli&quot;: &quot;^7.2.3&quot;,
    &quot;@babel/core&quot;: &quot;^7.2.2&quot;,
    &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.2.0&quot;,
    &quot;@babel/plugin-transform-runtime&quot;: &quot;^7.2.0&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.3.1&quot;,
    &quot;@babel/preset-react&quot;: &quot;^7.0.0&quot;,
    &quot;babel-core&quot;: &quot;^7.0.0-bridge.0&quot;,
    &quot;babel-jest&quot;: &quot;^24.0.0&quot;,
    &quot;babel-loader&quot;: &quot;^7.1.5&quot;,
    &quot;css-loader&quot;: &quot;^1.0.1&quot;,
    &quot;cypress&quot;: &quot;^3.1.3&quot;,
    &quot;enzyme&quot;: &quot;^3.8.0&quot;,
    &quot;enzyme-adapter-react-16&quot;: &quot;^1.7.1&quot;,
    &quot;enzyme-to-json&quot;: &quot;^3.3.5&quot;,
    &quot;extract-text-webpack-plugin&quot;: &quot;^4.0.0-beta.0&quot;,
    &quot;html-webpack-plugin&quot;: &quot;^3.2.0&quot;,
    &quot;jest&quot;: &quot;^24.0.0&quot;,
    &quot;jest-fetch-mock&quot;: &quot;^2.0.1&quot;,
    &quot;json-loader&quot;: &quot;^0.5.7&quot;,
    &quot;nodemon&quot;: &quot;^1.18.9&quot;,
    &quot;npm-run-all&quot;: &quot;^4.1.5&quot;,
    &quot;open&quot;: &quot;0.0.5&quot;,
    &quot;redux-devtools&quot;: &quot;^3.4.2&quot;,
    &quot;redux-mock-store&quot;: &quot;^1.5.3&quot;,
    &quot;regenerator-runtime&quot;: &quot;^0.13.1&quot;,
    &quot;style-loader&quot;: &quot;^0.23.1&quot;,
    &quot;uglifyjs-webpack-plugin&quot;: &quot;^2.0.1&quot;,
    &quot;webpack&quot;: &quot;^4.26.1&quot;,
    &quot;webpack-cli&quot;: &quot;^3.1.2&quot;,
    &quot;webpack-dev-server&quot;: &quot;^3.1.14&quot;,
    &quot;webpack-node-externals&quot;: &quot;^1.7.2&quot;
  },
  &quot;babel&quot;: {
    &quot;presets&quot;: [
      &quot;@babel/preset-env&quot;,
      &quot;@babel/preset-react&quot;
    ],
    &quot;plugins&quot;: [
      &quot;@babel/plugin-transform-runtime&quot;,
      &quot;@babel/plugin-proposal-class-properties&quot;
    ]
  }"><pre class="notranslate"><span class="pl-s">"dependencies"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"express"</span>: <span class="pl-s">"^4.16.4"</span><span class="pl-kos">,</span>
    <span class="pl-s">"isomorphic-fetch"</span>: <span class="pl-s">"^2.2.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react"</span>: <span class="pl-s">"^16.6.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-dom"</span>: <span class="pl-s">"^16.6.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-redux"</span>: <span class="pl-s">"^5.1.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-router"</span>: <span class="pl-s">"^4.3.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-router-config"</span>: <span class="pl-s">"^1.0.0-beta.4"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-router-dom"</span>: <span class="pl-s">"^4.3.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"redux"</span>: <span class="pl-s">"^4.0.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"redux-thunk"</span>: <span class="pl-s">"^2.3.0"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"devDependencies"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"@babel/cli"</span>: <span class="pl-s">"^7.2.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/core"</span>: <span class="pl-s">"^7.2.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-class-properties"</span>: <span class="pl-s">"^7.2.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-transform-runtime"</span>: <span class="pl-s">"^7.2.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-env"</span>: <span class="pl-s">"^7.3.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-react"</span>: <span class="pl-s">"^7.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-core"</span>: <span class="pl-s">"^7.0.0-bridge.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-jest"</span>: <span class="pl-s">"^24.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-loader"</span>: <span class="pl-s">"^7.1.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"css-loader"</span>: <span class="pl-s">"^1.0.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cypress"</span>: <span class="pl-s">"^3.1.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"enzyme"</span>: <span class="pl-s">"^3.8.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"enzyme-adapter-react-16"</span>: <span class="pl-s">"^1.7.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"enzyme-to-json"</span>: <span class="pl-s">"^3.3.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"extract-text-webpack-plugin"</span>: <span class="pl-s">"^4.0.0-beta.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"html-webpack-plugin"</span>: <span class="pl-s">"^3.2.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"jest"</span>: <span class="pl-s">"^24.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"jest-fetch-mock"</span>: <span class="pl-s">"^2.0.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"json-loader"</span>: <span class="pl-s">"^0.5.7"</span><span class="pl-kos">,</span>
    <span class="pl-s">"nodemon"</span>: <span class="pl-s">"^1.18.9"</span><span class="pl-kos">,</span>
    <span class="pl-s">"npm-run-all"</span>: <span class="pl-s">"^4.1.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"open"</span>: <span class="pl-s">"0.0.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"redux-devtools"</span>: <span class="pl-s">"^3.4.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"redux-mock-store"</span>: <span class="pl-s">"^1.5.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"regenerator-runtime"</span>: <span class="pl-s">"^0.13.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"style-loader"</span>: <span class="pl-s">"^0.23.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"uglifyjs-webpack-plugin"</span>: <span class="pl-s">"^2.0.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack"</span>: <span class="pl-s">"^4.26.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack-cli"</span>: <span class="pl-s">"^3.1.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack-dev-server"</span>: <span class="pl-s">"^3.1.14"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack-node-externals"</span>: <span class="pl-s">"^1.7.2"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"babel"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
      <span class="pl-s">"@babel/preset-env"</span><span class="pl-kos">,</span>
      <span class="pl-s">"@babel/preset-react"</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
      <span class="pl-s">"@babel/plugin-transform-runtime"</span><span class="pl-kos">,</span>
      <span class="pl-s">"@babel/plugin-proposal-class-properties"</span>
    <span class="pl-kos">]</span>
  <span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): [&gt; v7]</li>
<li>Node/npm version: [Node 8.12.0/npm 6.4.1]</li>
<li>OS: [Windows 10]</li>
</ul>
<p dir="auto"><a href="https://stackoverflow.com/questions/54400675/something-in-your-build-process-is-loading-the-wrong-version" rel="nofollow">Stackoverflow</a></p>