-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Missing module error with the babelification #144
Comments
@sindresorhus babel transpile files with var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default']; At the top, but in Module {
id: '/Users/floatdrop/github.com/got/test/unix-socket.js',
exports: {},
parent:
Module {
id: '/Users/floatdrop/github.com/got/node_modules/ava/node_modules/require-from-string/index.js',
exports: [Function: requireFromString],
parent:
Module {
id: '.',
exports: {},
parent: null,
filename: '/Users/floatdrop/github.com/got/node_modules/ava/lib/babel.js',
loaded: false,
children: [Object],
paths: [Object] },
filename: '/Users/floatdrop/github.com/got/node_modules/ava/node_modules/require-from-string/index.js',
loaded: true,
children: [ [Circular] ],
paths:
[ '/Users/floatdrop/github.com/got/node_modules/ava/node_modules/require-from-string/node_modules',
'/Users/floatdrop/github.com/got/node_modules/ava/node_modules',
'/Users/floatdrop/github.com/got/node_modules',
'/Users/floatdrop/github.com/node_modules',
'/Users/floatdrop/node_modules',
'/Users/node_modules',
'/node_modules' ] },
filename: '/Users/floatdrop/github.com/got/test/unix-socket.js',
loaded: false,
children: [],
paths:
[ '/Users/floatdrop/github.com/got/test/node_modules',
'/Users/floatdrop/github.com/got/node_modules',
'/Users/floatdrop/github.com/node_modules',
'/Users/floatdrop/node_modules',
'/Users/node_modules',
'/node_modules' ] } It looks like we should add some paths to |
Removing |
So including For Node.js 0.10.x we need We could append regenerator runtime before test code, but if we append Promise polyfill - it will leak into test code scope, which is bad (but not in module which is good). Or make Promise local to regenerator with @sindresorhus wdyt? |
This sounds like the best solution, but I would say we go with the fastest solution now. We can do it properly later. This issue is blocking AVA 0.4.0, so would be nice to get it fixed as fast as possible. |
Are we including this now? If not, that's a regression too. |
Simply installing It seems to me the requires in the transpiled code are trying to resolve from the wrong directory to get access to It should be possible to use derequire to change all the
|
@sindresorhus all polyfills now excluded from tests, because they affect tested code. @jamestalmage resolution is happening in right directory, but yes, there is no |
With Babel 6 we can use https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime, right?
|
Actually, in the Babel 5 docs, it says that the
|
@sindresorhus then it is worth to workaround require somehow:
|
Are you sure you meant |
@sindresorhus yeah. I think I give a |
Agreed. |
@floatdrop after 1d5ef4c landed I'm now getting this error when testing
got
using master.The text was updated successfully, but these errors were encountered: