Skip to content
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

Unknown option: direct.presets #13

Closed
quicksnap opened this issue Mar 31, 2016 · 7 comments
Closed

Unknown option: direct.presets #13

quicksnap opened this issue Mar 31, 2016 · 7 comments
Labels

Comments

@quicksnap
Copy link

My project uses Babel 5. Following the setup example, I when I run npm run storybook, I get:

ERROR in ./.storybook/config.js
Module build failed: ReferenceError: [BABEL] /Users/dan/projects/my-project/.storybook/config.js: Unknown option: direct.presets
    at Logger.error (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/file/logger.js:58:11)
    at OptionManager.mergeOptions (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:29)
    at OptionManager.init (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:10)
    at File.initOptions (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/file/index.js:147:75)
    at new File (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/file/index.js:137:22)
    at Pipeline.transform (/Users/dan/projects/my-project/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at transpile (/Users/dan/projects/my-project/node_modules/babel-loader/index.js:12:22)
    at Object.module.exports (/Users/dan/projects/my-project/node_modules/babel-loader/index.js:69:12)
 @ multi preview

It comes from the Webpack output. This error seems like a Babel 5/6 mismatch of some sort. Should Babel 6 be a peer dependency, or is this able to work with legacy Babel?

@quicksnap
Copy link
Author

Node 4.2.0 / NPM 3.8.1

@arunoda
Copy link
Member

arunoda commented Apr 1, 2016

Yes I think that's the issue. It's try to load babel5 inside this where we don't support.
I didn't find this. I assume, you need to upgrade to babel6 for now.

I'll see what I can do about this.

@arunoda arunoda added the bug label Apr 1, 2016
@quicksnap
Copy link
Author

I upgraded to Babel 6 and it works well. The bug is in Babel, and I couldn't figure out what was going wrong.

It may be worth considering making babel v6 a peer dependency and call it good.

@arunoda
Copy link
Member

arunoda commented Apr 1, 2016

Cool. I think that's something we can do.

@arunoda
Copy link
Member

arunoda commented Aug 23, 2016

I think we can close this now. Since everybody is using babel6.

@arunoda arunoda closed this as completed Aug 23, 2016
ndelangen pushed a commit that referenced this issue Apr 5, 2017
show cross only if text present
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Add android entry file for react native
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Change styles a bit for much better look and feel.
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Fix issue with end tag style
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 5, 2017
…20.0

@kadira/storybook@2.20.0 untested ⚠️
ndelangen added a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 11, 2017
…20.1

@kadira/storybook@2.20.1 untested ⚠️
ndelangen pushed a commit that referenced this issue Apr 11, 2017
ndelangen pushed a commit that referenced this issue Apr 11, 2017
Updated README to include sortStoriesByKind option
ndelangen pushed a commit that referenced this issue May 11, 2017
…20.0

@kadira/storybook@2.20.0 untested ⚠️
thani-sh pushed a commit that referenced this issue May 24, 2017
@hellogerard
Copy link

If anyone Googles into here, I was getting a similar, but slightly different, error:

ERROR in ./storybook/addons.js
Module build failed: ReferenceError: [BABEL] /Users/gerard/_work/crossroads-anywhere/react-native/storybook/addons.js: Unknown option: direct.presets
    at Logger.error (/Users/gerard/_work/crossroads-anywhere/react-native/node_modules/babel-core/lib/transformation/file/logger.js:58:11)

npm ls babel-core gave me:

├─┬ @storybook/cli@3.2.4
 └─┬ jscodeshift@0.3.32
   └── babel-core@5.8.38 

It sounded like Babel 5 was the problem, so I had to explicitly install Babel 6: npm i --save-dev babel-core@6.26.0. Not sure if that's a good idea or not, but it fixes the error and everything in my project still appears to be working.

@ndelangen
Copy link
Member

Thanks for posting your solution @hellogerard !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants