Property object of MemberExpression expected node to be of a type [“Expression”] but instead got null

This a generic error. For me I had a require state­ment inside an ES6 module.

Prob­lem

// analytics.js (ES6 Module with an error)

import {constants} from 'es6!helpers/analytics-constants';

var console = require('custom-console').bind('foo.js'); // Error : Babel seems to not able to transpile this with es2015 presets

Solu­tion

// analytics.js (ES6 Module without an error)

import {constants} from 'es6!helpers/analytics-constants';

import console from 'custom-console';
console.bind('foo.js');


You may also like...