-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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 issue with sb init
on the Vue CLI
#4535
Conversation
This was removed in e496dfb Probably we should not even be using this preset (see #4475 (comment)), but we are, so I will add this for now to get it working.
sb init
on the Vue CLI
// installBabel below. For some reason it leads to the wrong version of @babel/core (a beta) | ||
// being installed | ||
if (packageBabelCoreVersion === '7.0.0-bridge.0') { | ||
addToDevDependenciesIfNotPresent(packageJson, '@babel/core', babelCoreVersion); |
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.
So this leads to both babel-core
and @babel/core
being installed?
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.
Where the vue app uses babel-core
and storybook uses @babel/core
?
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.
Is this problematic? I don't know enough to understand the implications here.
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.
babel-core@7.0.0-bridge.0
is just a shim in front of @babel/core
.
I don't really know why the Vue CLI installs it as it appears to use babel7.
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.
The issue (seems to my limited eyes) to be that babel-core@7.0.0-bridge.0
depends on @babel/core@7.0.0-0
(note the -0
), which leads to this weird beta version of @babel/core
being installed. This overrides that.
I feel like this is a mistake in the vue CLI 🤷♂️
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.
Cool, that maybe makes sense.
Codecov Report
@@ Coverage Diff @@
## master #4535 +/- ##
==========================================
- Coverage 35.58% 35.57% -0.02%
==========================================
Files 557 557
Lines 6730 6732 +2
Branches 883 884 +1
==========================================
Hits 2395 2395
- Misses 3876 3877 +1
- Partials 459 460 +1
Continue to review full report at Codecov.
|
Confirmed fixed in rc.5 |
Issue: #4475
What I did
Re add
babel-preset-vue
to vue init script.Also install a manual dep on
@babel/core
, to fix yarn problems.How to test