• 0

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 statement inside an ES6 module.

Problem

// 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

Solution

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

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

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