Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolving to a different Babel version #129

Closed
TrySound opened this issue Nov 5, 2015 · 15 comments · Fixed by #147
Closed

resolving to a different Babel version #129

TrySound opened this issue Nov 5, 2015 · 15 comments · Fixed by #147

Comments

@TrySound
Copy link
Contributor

TrySound commented Nov 5, 2015

import test from 'ava';

test('name', t => {
    t.pass();
    t.end();
});
C:\Users\Frontend\AppData\Roaming\nvm\v0.12.5\node_modules\ava\node_modules\babel-core\lib\transformation\plugin.js:121
      throw new TypeError(messages.get("pluginNotFile", this.key));
            ^
TypeError: Plugin "babel-plugin-espower" is resolving to a different Babel version than what is performing the transform
ation.
    at Plugin.buildPass (C:\Users\Frontend\AppData\Roaming\nvm\v0.12.5\node_modules\ava\node_modules\babel-core\lib\tran
sformation\plugin.js:121:13)
    at PluginManager.add (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\transformation\file\plugin-manager.js:216:5
5)
    at File.buildTransformers (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\transformation\file\index.js:237:21)
    at new File (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\transformation\file\index.js:139:10)
    at Pipeline.transform (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\transformation\pipeline.js:164:16)
    at Object.transformFileSync (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\api\node.js:137:37)
    at compile (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\api\register\node.js:132:20)
    at normalLoader (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\api\register\node.js:199:14)
    at Object.require.extensions.(anonymous function) [as .js] (D:\Workflow\sandbox\aa\node_modules\babel-core\lib\api\r
egister\node.js:216:7)
    at Module.load (module.js:355:32)
TypeError: Cannot read property 'stack' of undefined
    at error (C:\Users\Frontend\AppData\Roaming\nvm\v0.12.5\node_modules\ava\cli.js:50:19)
    at processImmediate [as _immediateCallback] (timers.js:367:17)
From previous event:
    at Object.<anonymous> (C:\Users\Frontend\AppData\Roaming\nvm\v0.12.5\node_modules\ava\cli.js:206:34)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
@sindresorhus
Copy link
Member

Do you have a local Babel install? If so, what version?

// @twada

@sindresorhus
Copy link
Member

@TrySound Not a very useful title. Please try harder the next time ;)

@TrySound
Copy link
Contributor Author

TrySound commented Nov 5, 2015

@sindresorhus I just don't know what is the problem :))

  "devDependencies": {
    "ava": "^0.3.0"
  },

and global the same

@TrySound TrySound changed the title Don't want to work on windows resolving to a different Babel version Nov 5, 2015
@forabi
Copy link

forabi commented Nov 5, 2015

I have the exact same error on Linux, so apparently it does not have anything to do with Windows.
Here is my devDependencies:

{
    "ava": "^0.3.0",
    "babel": "^5.8.23",
    "babel-runtime": "^5.8.25"
}

My .babelrc

{
  "stage": 1,
  "optional": ["es7.classProperties", "es7.comprehensions"]
}

@TrySound
Copy link
Contributor Author

TrySound commented Nov 5, 2015

@sindresorhus I use npm3. Maybe babel5 doesn't work on it?

@forabi
Copy link

forabi commented Nov 6, 2015

@TrySound Well, I thought that was the cause, so I switched to node 0.12 and npm 2, but the issue is still present. So it is not that either.

@uiur
Copy link
Contributor

uiur commented Nov 7, 2015

This might be because babel-plugin-espower does not use a local babel.

https://github.com/sindresorhus/ava/blob/1d5ef4c5f6fcb70f9e90e584dfd08865db1e93b4/lib/babel.js#L12

    plugins: [
        createEspowerPlugin(require('babel-core'), {
            patterns: require('./enhance-assert').PATTERNS
        })
    ]
};

This should be a mistake. I'll create a PR if I can reproduce it.

@uiur
Copy link
Contributor

uiur commented Nov 7, 2015

Reproduced in npm 2.14.2.

package.json

  "devDependencies": {
    "ava": "^0.3.0",
    "babel": "5.8.21",
    "babel-core": "5.8.21"
  }

test.js

import test from 'ava';

test((t) => {
  t.pass();
  t.end();
});
❯ node_modules/.bin/ava 

/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/ava/node_modules/babel-core/lib/transformation/plugin.js:121
      throw new TypeError(messages.get("pluginNotFile", this.key));
      ^

TypeError: Plugin "babel-plugin-espower" is resolving to a different Babel version than what is performing the transformation.
    at Plugin.buildPass (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/ava/node_modules/babel-core/lib/transformation/plugin.js:121:13)
    at PluginManager.add (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:216:55)
    at File.buildTransformers (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at Object.transformFileSync (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/api/node.js:133:37)
    at compile (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/api/register/node.js:132:20)
    at normalLoader (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/api/register/node.js:199:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:355:32)
TypeError: Cannot read property 'stack' of undefined
    at error (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/ava/cli.js:50:19)
    at processImmediate [as _immediateCallback] (timers.js:371:17)
From previous event:
    at Object.<anonymous> (/Users/zat/Code/Sandbox/babel-resolve-test/node_modules/ava/cli.js:206:34)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

@twada
Copy link
Contributor

twada commented Nov 7, 2015

@sindresorhus I'm so sorry that I've missed your ping.

@uiureo

I'll create a PR if I can reproduce it.

Thanks a lot!

@uiur
Copy link
Contributor

uiur commented Nov 7, 2015

@TrySound @forabi The patch has been merged into master. Could you try it?

@TrySound
Copy link
Contributor Author

TrySound commented Nov 7, 2015

@uiureo Seems like it works. Great! @sindresorhus Need to make hot patch. When you can release?

@sindresorhus
Copy link
Member

@TrySound
Copy link
Contributor Author

TrySound commented Nov 7, 2015

Okay. Thanks.

@sindresorhus
Copy link
Member

@TrySound
Copy link
Contributor Author

TrySound commented Nov 7, 2015

@sindresorhus Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants