Babel is unable to parse double colon despite there being a babel config present

254 Views Asked by At

enter image description here

I am trying to run build on a directory using Babel. I have a babel.config.js set up in the same directory. I would have expected this to compile but my lack of understanding of how Javascript runs is not letting me proceed here. Could someone please point out what could be going wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

The Babel docs say that to use it, you need to:

(1) Install the plugin:

npm install --save-dev @babel/plugin-proposal-function-bind

(2) Add it to your Babel config:

{
  "plugins": ["@babel/plugin-proposal-function-bind"]
}

Or, you could go back to the old syntax without using Babel at all:

this.on('client:beforeCommand', (...args) => this.onBeforeCommand(...args));