In my case, I had the following .babelrc config:
{
"presets": [
["env", { "modules": false }],
"react",
"stage-2"
],
"plugins": [
"transform-runtime",
"transform-class-properties",
"react-hot-loader/babel"
]
}
Even though babel-env was specified I still got the error. To fix it I had to remove the "modules": false flag.