Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

"Cross repository changes" instructions no longer working #447

Closed
ghost opened this issue Apr 3, 2017 · 8 comments
Closed

"Cross repository changes" instructions no longer working #447

ghost opened this issue Apr 3, 2017 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 3, 2017

Based on CONTRIBUTING.md, I did:

git clone git@github.com:andy-ms/babylon # My repos are both up-to-date, so this is the same as babel/babylon
git clone git@github.com:andy-ms/babel

cd babylon
yarn
yarn link
yarn run build

cd ../babel/
make bootstrap
yarn link babylon
cd packages/babel-core/
yarn link babylon
cd ../../packages/babel-template/
yarn link babylon
cd ../../packages/babel-traverse/
yarn link babylon
cd ../../packages/babel-generator/
yarn link babylon
cd ../..

make build
make test

And got this error:

./node_modules/.bin/eslint scripts packages *.js --format=codeframe
./scripts/test.sh
/home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:377
      throw e;
      ^

TypeError: [BABEL] /home/andy/bab/babylon/node_modules/istanbul-lib-instrument/dist/index.js: Plugin 0 specified in "/home/andy/bab/babylon/.babelrc.env.test" was expected to return a function but returned "undefined" (While processing preset: "/home/andy/bab/babylon/node_modules/babel-preset-stage-0/lib/index.js") (While processing preset: "/home/andy/bab/babylon/node_modules/babel-preset-es2015/lib/index.js")
    at Function.normalisePlugin (/home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:131:15)
    at /home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:167:30
    at Array.map (native)
    at Function.normalisePlugins (/home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:141:20)
    at OptionManager.mergeOptions (/home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:258:36)
    at OptionManager.init (/home/andy/bab/babel/node_modules/babel-core/lib/config/option-manager.js:370:14)
    at loadConfig (/home/andy/bab/babel/node_modules/babel-core/lib/config/index.js:13:50)
    at loadOptions (/home/andy/bab/babel/node_modules/babel-core/lib/index.js:110:37)
    at OptionManager.init (/home/andy/bab/babel/node_modules/babel-core/lib/index.js:121:12)
    at compile (/home/andy/bab/babel/node_modules/babel-register/lib/node.js:73:45)
    ...snip...
    at startup (bootstrap_node.js:147:9)
    at bootstrap_node.js:538:3
Makefile:48: recipe for target 'test-only' failed
make: *** [test-only] Error 1

yarn --version is 0.22.0 and I am on Linux Mint 18.

Pretty sure I had this working right a few weeks ago, so maybe something changed in babel?

@hzoo
Copy link
Member

hzoo commented Apr 3, 2017

Thought it was fixed by #442 but maybe doesn't solve linking

@loganfsmyth
Copy link
Member

This is indeed a regression due to a change in babel interacting with babylon in an unexpected way. babel/babel#5590 is one possible fix.

@ghost
Copy link
Author

ghost commented Apr 6, 2017

EDIT: Never mind, used wrong branch of babel.

The first error's been fixed, but after linking, I get some errors in yarn build in babel:

Compiling '/home/andy/bab/babel/packages/babel-helper-transform-fixture-test-runner/src/index.js'...
TypeError: /home/andy/bab/babel/packages/babel-helper-transform-fixture-test-runner/src/index.js: Cannot read property 'value' of undefined
    at getName (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-duplicate-keys/lib/index.js:85:13)
    at PluginPass.ObjectExpression (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-duplicate-keys/lib/index.js:41:22)
    at newFn (/home/andy/bab/babel/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/home/andy/bab/babel/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/home/andy/bab/babel/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/home/andy/bab/babel/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/home/andy/bab/babel/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/home/andy/bab/babel/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (/home/andy/bab/babel/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (/home/andy/bab/babel/node_modules/babel-traverse/lib/index.js:114:17)

... snip ...

Compiling '/home/andy/bab/babel/packages/babel-core/src/transformation/file/options/removed.js'...
TypeError: /home/andy/bab/babel/packages/babel-core/src/transformation/file/options/option-manager.js: Property property of MemberExpression expected node to be of a type ["Identifier"] but instead got null
    at validate (/home/andy/bab/babel/node_modules/babel-types/lib/definitions/index.js:109:13)
    at Object.validate (/home/andy/bab/babel/node_modules/babel-types/lib/definitions/core.js:412:50)
    at validate (/home/andy/bab/babel/node_modules/babel-types/lib/index.js:505:9)
    at Object.builder (/home/andy/bab/babel/node_modules/babel-types/lib/index.js:466:7)
    at DestructuringTransformer.pushObjectProperty (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-destructuring/lib/index.js:174:22)
    at DestructuringTransformer.pushObjectPattern (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-destructuring/lib/index.js:200:16)
    at DestructuringTransformer.push (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-destructuring/lib/index.js:108:14)
    at DestructuringTransformer.init (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-destructuring/lib/index.js:317:12)
    at PluginPass.VariableDeclaration (/home/andy/bab/babel/node_modules/babel-plugin-transform-es2015-destructuring/lib/index.js:468:27)
    at newFn (/home/andy/bab/babel/node_modules/babel-traverse/lib/visitors.js:276:21)

(The command succeeds before running yarn link babylon.)

@loganfsmyth
Copy link
Member

Weird. I'm not able to reproduce that on my end.

@ghost
Copy link
Author

ghost commented Apr 6, 2017

Yeah, I was on the wrong branch. Fixed with git checkout 7.0.
However, I do get an error in make test in babel after linking:

  1) browserify babel/register may be used without breaking browserify:
     Uncaught TypeError: require(...).default is not a function
      at Object.1.babel-register (evalmachine.<anonymous>:3:34)
      at s (evalmachine.<anonymous>:2:254)
      at e (evalmachine.<anonymous>:2:425)
      at evalmachine.<anonymous>:2:443
      at ContextifyScript.Script.runInContext (vm.js:32:29)
      at ContextifyScript.Script.runInNewContext (vm.js:38:15)
      at Object.runInNewContext (vm.js:91:38)
      at packages/babel-core/test/browserify.js:15:10
      at node_modules/browserify/index.js:779:13
      at ConcatStream.<anonymous> (node_modules/concat-stream/index.js:36:43)

And verified that this does not happen on a clean checkout without yarn link.

@loganfsmyth
Copy link
Member

That sounds like things didn't link properly in Babel. That's definitely a function, but not in babel-register@7.x, not in babel-register@6.x so if things didn't link right, that could happen.

Could you try to make clean && make watch then make bootstrap in babel?

@ghost
Copy link
Author

ghost commented Apr 6, 2017

Thanks, it works after cleaning.

@hzoo
Copy link
Member

hzoo commented Apr 6, 2017

make bootstrap now runs make clean beforehand so that should reset everything (for Babel 7.x)

@ghost ghost closed this as completed Apr 6, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants