Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin 0 specified in babel-preset-es2015 provided an invalid property of _c

Tags:

babeljs

Getting above error with below configuration, commenting passPerPreset removes the error however. Is there any configuration missing ?

.babelrc :

{
  "passPerPreset": true,
  "presets": [{
      "plugins": [
        "./build/babelRelayPlugin",
        "transform-runtime",
        "transform-es2015-classes"
      ]
    }, "es2015", "stage-0", "react"],
  "env": {
     "development": {
      "presets": ["react-hmre"]
    }
  }
}

package.json :

"babel-cli": "^6.5.1",
"babel-core": "^6.5.2",
"babel-eslint": "^4.1.8",
"babel-loader": "^6.2.2",
"babel-plugin-react-transform": "^2.0.0",
"babel-plugin-transform-es2015-classes": "^6.5.2",
"babel-plugin-transform-runtime": "^6.5.2",
"babel-polyfill": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babel-preset-react": "^6.5.0",
"babel-preset-react-hmre": "^1.1.0",
"babel-preset-stage-0": "^6.5.0",
"babel-relay-plugin": "^0.7.0",
"babel-runtime": "^6.5.0",

Webpack :

module: {
    loaders: [        
    {
      loader: "babel-loader",
      include: [
        path.resolve(__dirname, "app"),
      ],
      test: /\.jsx?$/,
      query: {
        plugins: ['transform-runtime'],
        presets: ['react', 'es2015', 'stage-0'],
      }
    },
  ]

},

Error : babel-node start

Module build failed: Error: Plugin 0 specified in "/Users/my/demo/node_modules/babel-preset-es2015/index.js" provided an invalid property of "_c"
like image 387
fortm Avatar asked Feb 14 '16 19:02

fortm


2 Answers

What worked for me was:

rm -rf node_modules
npm prune
npm cache clear
npm cache clean
npm i
like image 155
Alex Cory Avatar answered Nov 16 '22 15:11

Alex Cory


Upgrading babel-core and babel-loader fixed this for me.

npm install --save babel-core@latest babel-loader@latest
like image 6
AMStrix Avatar answered Nov 16 '22 15:11

AMStrix