Search code examples
reactjsreduxecmascript-6destructuring

t.isRestProperty is not a function at DestructuringTransformer.pushObjectPattern


The code I am trying to execute is as below.

const obj = {place: 'kar', number: 45};
const {place, number} = obj;
console.log(place);

I get the following error while using ES6 object destructuring.

t.isRestProperty is not a function
    at DestructuringTransformer.pushObjectPattern

I have updated babel-core, babel-loader, webpack, and @babel/cli


Solution

  • The issue is resolved now. The error was thrown due to the conflicts between the versions of babel-core, babel-loader and babel-cli. Now the issue is resolved after I installed them afresh with following versions. "dependencies": { "babel-cli": "6.24.1", "babel-core": "6.25.0", "babel-loader": "7.1.1",