<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    throw new Error(&quot;We don't know what to do with this node type. &quot; + &quot;We were previously a Statement but we can't fit in here?&quot;);
    ^

Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
    at NodePath.insertBefore (node_modules/@babel/traverse/lib/path/modification.js:57:11)
    at PluginPass.Class (node_modules/@babel/plugin-proposal-class-properties/lib/index.js:475:14)
    at newFn (node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:90:19)
    at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:146:19)
    at Function.traverse.node (node_modules/@babel/traverse/lib/index.js:94:17)"><pre class="notranslate"><code class="notranslate">    throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
    ^

Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
    at NodePath.insertBefore (node_modules/@babel/traverse/lib/path/modification.js:57:11)
    at PluginPass.Class (node_modules/@babel/plugin-proposal-class-properties/lib/index.js:475:14)
    at newFn (node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:90:19)
    at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:146:19)
    at Function.traverse.node (node_modules/@babel/traverse/lib/index.js:94:17)
</code></pre></div>
<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="import React from &quot;react&quot;;

export class App extends React.Component {
  constructor(props) { super(props); }
  f = () =&gt; { const { props } = this; }
  static g = () =&gt; null;

  render() { return null; }
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">"react"</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">App</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
  <span class="pl-c1">f</span> <span class="pl-c1">=</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-k">const</span> <span class="pl-kos">{</span> props <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
  <span class="pl-k">static</span> <span class="pl-c1">g</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">null</span><span class="pl-kos">;</span>

  <span class="pl-en">render</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-c1">null</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>
Errors out in babel 7 b45+, works in babel 77 b44.<br>
Also, babel is very preculiar when repoing this error.  if you try to change the code a little bit more, eg removing f or g, removing export call, remove constructor or contents of f etc etc the error probably  goes away.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong><br>
./node_modules/.bin/babel-node src/index.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;@babel/core&quot;: &quot;7.0.0-beta.49&quot;,
    &quot;@babel/preset-env&quot;: &quot;7.0.0-beta.49&quot;,
    &quot;@babel/preset-react&quot;: &quot;7.0.0-beta.49&quot;,
    &quot;@babel/node&quot;: &quot;7.0.0-beta.49&quot;,
    &quot;@babel/runtime&quot;: &quot;7.0.0-beta.49&quot;,"><pre class="notranslate"><span class="pl-s">"@babel/core"</span>: <span class="pl-s">"7.0.0-beta.49"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-env"</span>: <span class="pl-s">"7.0.0-beta.49"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-react"</span>: <span class="pl-s">"7.0.0-beta.49"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/node"</span>: <span class="pl-s">"7.0.0-beta.49"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/runtime"</span>: <span class="pl-s">"7.0.0-beta.49"</span><span class="pl-kos">,</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;@babel/env&quot;,
    &quot;@babel/preset-react&quot;,
  ],
  &quot;plugins&quot;: [&quot;@babel/plugin-proposal-class-properties&quot;]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": [
    "@babel/env",
    "@babel/preset-react",
  ],
  "plugins": ["@babel/plugin-proposal-class-properties"]
}
</code></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): v7.0.0-beta.49</li>
<li>Node/npm version:  Node 8.9.3/npm 6</li>
<li>OS:  OSX 10.13.4</li>
<li>Monorepo no</li>
<li>How you are using Babel: cli</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context/Screenshots</strong><br>
works in babel 7 b44</p>
<p dir="auto">I'm reporting an error I get for every React component exported after I upgraded to @babel/*@^7.0.0-beta.37:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in ./apps/visitor/components/List.js
Module build failed: Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?"><pre class="notranslate"><code class="notranslate">ERROR in ./apps/visitor/components/List.js
Module build failed: Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
</code></pre></div>
<p dir="auto">I already checked this out <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="284884939" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/7122" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/7122/hovercard" href="https://github.com/babel/babel/issues/7122">#7122</a> where the problem was a version mismatch but it does not seem my case.</p>
<p dir="auto">Babel config in package.json:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;babel&quot;: {
    &quot;presets&quot;: [
        [
            &quot;@babel/preset-env&quot;,
            {
                &quot;modules&quot;: false,
                &quot;useBuiltIns&quot;: &quot;usage&quot;,
                &quot;debug&quot;: true
            }
        ],
        &quot;@babel/preset-stage-0&quot;,
        &quot;@babel/preset-react&quot;
    ],
    &quot;plugins&quot;: [
        &quot;lodash&quot;,
        &quot;@babel/plugin-proposal-decorators&quot;,
        [
            &quot;@babel/plugin-proposal-class-properties&quot;,
            {
                &quot;loose&quot;: true
            }
        ]
    ]
},"><pre class="notranslate"><code class="notranslate">"babel": {
    "presets": [
        [
            "@babel/preset-env",
            {
                "modules": false,
                "useBuiltIns": "usage",
                "debug": true
            }
        ],
        "@babel/preset-stage-0",
        "@babel/preset-react"
    ],
    "plugins": [
        "lodash",
        "@babel/plugin-proposal-decorators",
        [
            "@babel/plugin-proposal-class-properties",
            {
                "loose": true
            }
        ]
    ]
},
</code></pre></div>
<p dir="auto">Dependencies version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;devDependencies&quot;: {
    &quot;@babel/core&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;@babel/plugin-proposal-decorators&quot;: &quot;7.0.0-beta.37&quot;,
    &quot;@babel/polyfill&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;@babel/preset-react&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;@babel/preset-stage-0&quot;: &quot;^7.0.0-beta.37&quot;,
    &quot;babel-eslint&quot;: &quot;8.2.1&quot;,
    &quot;babel-jest&quot;: &quot;22.0.4&quot;,
    &quot;babel-loader&quot;: &quot;8.0.0-beta.0&quot;,
    &quot;babel-minify-webpack-plugin&quot;: &quot;0.2.0&quot;,
    &quot;babel-plugin-lodash&quot;: &quot;3.3.2&quot;,
    ...
}"><pre class="notranslate"><code class="notranslate">"devDependencies": {
    "@babel/core": "^7.0.0-beta.37",
    "@babel/plugin-proposal-class-properties": "^7.0.0-beta.37",
    "@babel/plugin-proposal-decorators": "7.0.0-beta.37",
    "@babel/polyfill": "^7.0.0-beta.37",
    "@babel/preset-env": "^7.0.0-beta.37",
    "@babel/preset-react": "^7.0.0-beta.37",
    "@babel/preset-stage-0": "^7.0.0-beta.37",
    "babel-eslint": "8.2.1",
    "babel-jest": "22.0.4",
    "babel-loader": "8.0.0-beta.0",
    "babel-minify-webpack-plugin": "0.2.0",
    "babel-plugin-lodash": "3.3.2",
    ...
}
</code></pre></div>
<p dir="auto">Thanks for the amazing work on this project as always 💪🏻</p>