Issue 1:
Bug Report

Current Behavior

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)

Input Code

import React from "react";

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

render() { return null; }
}

Expected behavior/code

Errors out in babel 7 b45+, works in babel 77 b44.

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.

Babel Configuration (.babelrc, package.json, cli command)

./node_modules/.bin/babel-node src/index.js

"@babel/core": "7.0.0-beta.49",
"@babel/preset-env": "7.0.0-beta.49",
"@babel/preset-react": "7.0.0-beta.49",
"@babel/node": "7.0.0-beta.49",
"@babel/runtime": "7.0.0-beta.49",

{
"presets": [
"@babel/env",
"@babel/preset-react",
],
"plugins": ["@babel/plugin-proposal-class-properties"]
}

Environment

Babel version(s): v7.0.0-beta.49

Node/npm version: Node 8.9.3/npm 6

OS: OSX 10.13.4

Monorepo no

How you are using Babel: cli

Possible Solution

Additional context/Screenshots

works in babel 7 b44

Issue 2:
I'm reporting an error I get for every React component exported after I upgraded to @babel/*@^7.0.0-beta.37:

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?

I already checked this out #7122 where the problem was a version mismatch but it does not seem my case.

Babel config in package.json:

"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
}
]
]
},

Dependencies version:

"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",
...
}

Thanks for the amazing work on this project as always 💪🏻