TypeError: Cannot read property 'babel' of undefined
Your version of babel-loader looks to be out of date. Uninstall it with npm uninstall babel-loader
and re-install with npm i -D babel-loader
. You may also need to update to babel-preset-env
and remove babel-preset-es2015
https://babeljs.io/docs/en/env/#upgrading-to-babel-preset-env
For me it was a version mismatch between webpack and babel-loader.
I had babel-loader@6.2.0
with webpack@4.12.0
, updating to babel-loader@7.1.4
fixed the issue for me.