Closed bustEXZ closed 6 years ago
Please use babel-bringe for now.
Storybook 4.0 will have Babel 7 out of the box, you can track the progress in #3746
That still won't cut it, I believe: babel-loader@7.1.5
has a peer dependency on babel-core@6
. That means we can't use babel-core@^7.0.0-0
(which is babel-bridge
). Everything works in the app, but the dependencies aren't happy.
How can we use babel-loader@8
without Babel 7?
Oh, maybe I misunderstood. How can you use babel-bridge
without Babel 7? babel-bridge
is Babel 7, no?
How can you use babel-bridge without Babel 7
We (storybook itself) don't (yet), but you (your app) can
My point was that we can't update babel-loader on our side without migrating to Babel 7 as default, which is being done in #3746
If you have yarn, you can use yarn resolutions to enforce v8 though
Ah, I see what you're saying. We've done that with resolutions
, which is why I say everything works in the app, but it breaks yarn check
.
Is there a way to set the dependencies so that the peer dependencies allow for 7 in the app, but the direct dependency still uses 6 for Storybook's internals?
If Babel is being used to build Storybook, should the babel-*
packages in @storybook/core
's package.json
be moved to devDependencies
? Then our apps wouldn't have a conflict.
Is there a way to set the dependencies so that the peer dependencies allow for 7 in the app
This is exactly how it works right now. Or do you mean to make babel-loader
a peer dependency as well? Actually, sounds like a good idea
If Babel is being used to build Storybook, should the babel-* packages in @storybook/core's package.json be moved to devDependencies? Then our apps wouldn't have a conflict.
No, those are to build user stories
With and without dependencies babel-bridge@1.12.11
:
ERROR in ./.storybook/config.js
Module build failed (from ./node_modules/@storybook/core/node_modules/babel-loader/lib/index.js):
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.0". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
... same error in first post
at /home/barbashev/workspace/Frontend/Component/navigator/node_modules/@storybook/core/node_modules/babel-loader/lib/fs-cache.js:118:18
at ReadFileContext.callback (/home/barbashev/workspace/Frontend/Component/navigator/node_modules/@storybook/core/node_modules/babel-loader/lib/fs-cache.js:31:21)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)
@ multi ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/server/config/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true
ERROR in ./.storybook/addons.js
Module build failed (from ./node_modules/@storybook/core/node_modules/babel-loader/lib/index.js):
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.0". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
.....
I add postintall script to rm node_modules/babel-core
and all worked without babel-bridge
.
If you know best idea to fix this, please notify :)
@bustEXZ You have solutions
BTW. babel-bridge didn't solved the warning https://github.com/babel/babel/issues/6824
Doing yarn add --dev babel-core@^7.0.0-0
, I still have
$ yarn check
yarn check v1.7.0
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
error "babel-loader#babel-core@6" doesn't satisfy found match of "babel-core@7.0.0-bridge.0"
...
Explanation of babel-bridge:
Babel published a babel@7.0.0-bridge.0 package, which takes npm version precedence over the babel@7.0.0-beta.0 we're relying on (yes, as in, "beta" < "bridge", alphabetically) https://github.com/meteor/meteor/pull/9396#issuecomment-345708811
@rofrol 1, 2 allready complete
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
@bustEXZ it should be babel-core@7.0.0-bridge.0
not babel-bridge@1.12.11
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
package.json
.babelrc
When we try to start storybook, we have an error:
It solves if we go to
/node_modules/@storybook/core/node_modules/babel-loader/lib/index.js:3:13
and change require from "babel-core" to "@babel/core".