-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix babel-standalone for realz #6137
Conversation
@Daniel15, thanks for your PR! By analyzing the history of the files in this pull request, we identified @existentialism, @hzoo and @ChauTNguyen to be potential reviewers. |
This doesn't seem to fix it. I still get a |
Hmm, that's interesting @jridgewell... I wonder why it's working for me locally? I even rebased on top of your PR and it built fine. I'll keep digging, I might just have to hack the module resolution. |
@jridgewell - Are you sure you ran |
Yup. ✓ jridgewell@Dandy ~/src/babel class-private-properties git log
Sat Aug 19 20:18:25 2017 -0400 ef6ea1022 (HEAD -> class-private-properties) Merge branch 'pr/6137' into class-private-properties [Justin Ridgewell]
Sat Aug 19 17:01:15 2017 -0700 eb138bba7 (pr/6137) Fix infinite loop in Makefile (oops) [Daniel Lo Nigro]
Sat Aug 19 16:41:05 2017 -0700 e5dcf16ab Bump Yarn version to see if it fixes the CircleCI build [Daniel Lo Nigro]
Sat Aug 19 16:26:34 2017 -0700 16007eccd Fix babel-standalone [Daniel Lo Nigro]
Sat Aug 19 22:35:40 2017 +0900 c6a094a9d Split export extensions into 2 different plugins, update stage presets (#6080) [Sangboak Lee]
Fri Aug 18 23:42:39 2017 -0400 3818a64ee (origin/class-private-properties) Final fixes [Justin Ridgewell]
✓ jridgewell@Dandy ~/src/babel class-private-properties node -v
v8.0.0
✓ jridgewell@Dandy ~/src/babel class-private-properties npm -v
5.3.0
✓ jridgewell@Dandy ~/src/babel class-private-properties yarn --version
0.28.4
✓ jridgewell@Dandy ~/src/babel class-private-properties make bootstrap
...
ERROR in ./src/index.js
Module build failed: Error: [BABEL] /Users/jridgewell/src/babel/packages/babel-standalone/src/index.js: You gave us a visitor for the node type "PrivateName" but it's not a valid type
at verify (/Users/jridgewell/src/babel/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:156:13)
at Function.explode (/Users/jridgewell/src/babel/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:59:3)
at instantiatePlugin (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:304:27)
at loadPluginDescriptor (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:280:14)
at /Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:73:14
at Array.map (native)
at OptionManager.mergeOptions (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:72:34)
at /Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:100:15
at Array.forEach (native)
at OptionManager.mergeOptions (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:99:15)
✘ jridgewell@Dandy ~/src/babel class-private-properties ls node_modules | grep babel-loader
babel-loader |
Huh. Strange. I'll take another shot at fixing this. Thanks for confirming.
Sent from my phone.
…On Aug 19, 2017 7:41 PM, "Justin Ridgewell" ***@***.***> wrote:
Yup.
✓ ***@***.*** ~/src/babel class-private-properties git log
Sat Aug 19 20:18:25 2017 -0400 ef6ea1022 (HEAD -> class-private-properties) Merge branch 'pr/6137' into class-private-properties [Justin Ridgewell]
Sat Aug 19 17:01:15 2017 -0700 eb138bb (pr/6137) Fix infinite loop in Makefile (oops) [Daniel Lo Nigro]
Sat Aug 19 16:41:05 2017 -0700 e5dcf16 Bump Yarn version to see if it fixes the CircleCI build [Daniel Lo Nigro]
Sat Aug 19 16:26:34 2017 -0700 16007ec Fix babel-standalone [Daniel Lo Nigro]
Sat Aug 19 22:35:40 2017 +0900 c6a094a Split export extensions into 2 different plugins, update stage presets (#6080) [Sangboak Lee]
Fri Aug 18 23:42:39 2017 -0400 3818a64 (origin/class-private-properties) Final fixes [Justin Ridgewell]
✓ ***@***.*** ~/src/babel class-private-properties node -v
v8.0.0
✓ ***@***.*** ~/src/babel class-private-properties npm -v
5.3.0
✓ ***@***.*** ~/src/babel class-private-properties yarn --version
0.28.4
✓ ***@***.*** ~/src/babel class-private-properties make bootstrap
...
ERROR in ./src/index.js
Module build failed: Error: [BABEL] /Users/jridgewell/src/babel/packages/babel-standalone/src/index.js: You gave us a visitor for the node type "PrivateName" but it's not a valid type at verify (/Users/jridgewell/src/babel/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:156:13) at Function.explode (/Users/jridgewell/src/babel/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:59:3) at instantiatePlugin (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:304:27) at loadPluginDescriptor (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:280:14) at /Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:73:14 at Array.map (native) at OptionManager.mergeOptions (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:72:34) at /Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:100:15 at Array.forEach (native) at OptionManager.mergeOptions (/Users/jridgewell/src/babel/node_modules/babel-core/lib/config/option-manager.js:99:15) ✘ ***@***.*** ~/src/babel class-private-properties ls node_modules | grep babel-loaderbabel-loader
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6137 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFnHUqV2KrKmji1riiBNMQRxsHWdQGmks5sZ5y7gaJpZM4O8eJk>
.
|
@jridgewell Could you please try the latest version and see if that works for you? To test, I rebased a copy of your branch on top of this branch, and it seems to build successfully on CircleCI. There's some test failures, not sure if they're directly related or not (seems not): https://circleci.com/gh/Daniel15/babel/29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, but it feels super hacky. Definitely need someone else to approve.
974ffe4
to
5b9722c
Compare
Ping @babel/core - Are you OK with this PR? |
I guess it feels kinda bad to have to do this but it's broken atm so ok 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this work?
# cwd = babel-core/
yarn link
cd ../babel-standalone/node_modules/babel-loader
yarn link babel-core
It still is very hacky (changing the dependencies of a dependency isn't something you see often), but it feels less hacky than overriding node's module resolution algorithm.
Anyway, this is just internal code: it doesn't need to be best possible.
* override Node's module resolution algorithm to specify a custom resolver for | ||
* babel-core to *force* it to use our version. | ||
* | ||
* Here be dragons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(You could add an emoji! 🐉 🐲 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always worried that inserting Emoji into code is going to break something somewhere 😛
It wouldn't :( The version at |
The root
package.json
has a reference tobabel-loader
andbabel-core
. The root babel-core comes from npm (for some reason) rather than the version in the repo itself, which causes odd issues. By installing babel-loader into babel-standalone'snode_modules
directory rather than the rootnode_modules
directory, it picks up the correct version of babel-core and everything works fine.Also made
gulpTasks.js
properly modular so babel-minify can reuse it.Huge thanks to @jridgewell for the initial investigation into this issue.