istanbuljs / babel-plugin-istanbul

A babel plugin that adds istanbul instrumentation to ES6 code
BSD 3-Clause "New" or "Revised" License
624 stars 73 forks source link

Support Babel 7 #156

Closed 4matic closed 6 years ago

4matic commented 6 years ago

Im using @babel monorepo v7.0.0-beta.49

{
...
"@babel/core": "7.0.0-beta.49",
"@babel/plugin-transform-runtime": "7.0.0-beta.49",
"@babel/polyfill": "7.0.0-beta.49",
"@babel/preset-env": "7.0.0-beta.49",
"@babel/register": "7.0.0-beta.49",
"@babel/runtime": "7.0.0-beta.49",
...
}

This produce error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel

How can I use babel-plugin-istanbul with Babel 7?

4matic commented 6 years ago

Problem was in my .nycrc file:

{
...
"require": ["babel-register"],
...
}

Changing babel-register to @babel/register fixed this error