Unknown option: direct.presets
See original GitHub issueMy 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?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Unknown option: presets · Issue #2949 · babel/babel - GitHub
I'm in the same boat. I'm using babel@6 with babel-loader (webpack) I've updated all my dependencies to @6 versions, both in the project...
Read more >26 - Stack Overflow
The reason was that I was trying to use react preset for babel but babel-react-preset was missing from my node_modules .The end result...
Read more >Module build failed: ReferenceError [BABEL] Unknown option
gulp does not work: Module build failed: ReferenceError [BABEL] Unknown option: direct.presets. We use Laravel 5.3.x and have elixir for build assets.
Read more >babel/preset-react
@babel/preset-react ... This preset always includes the following plugins: ... And with the development option: Classic runtime adds: ... Automatic runtime (since v7....
Read more >babel-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone Googles into here, I was getting a similar, but slightly different, error:
npm ls babel-core
gave me: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.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.