question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Root babel.config.js not loaded

See original GitHub issue

Describe the bug Storybook does not load any babel.config.js files (in either root or .storybook). It only loads .storybook/.babelrc files.

To Reproduce Steps to reproduce the behavior:

  1. Create a new storybook app
  2. Add a root-level babel.config.js file
  3. Run app
  4. See that config is not loaded

Expected behavior Storybook should be able to load both babel config formats.

Code snippets I believe this is the code responsible: https://github.com/storybooks/storybook/blob/fba0541a2bbbd3b51943b21d3f8d2282e33286d6/lib/core/src/server/utils/load-custom-babel-config.js#L62

System:

  • OS: MacOS
  • Device: Macbook Pro 2018
  • Framework: React
  • Version: 5.x

Additional context https://github.com/emotion-js/emotion/issues/1306

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:25
  • Comments:25 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
jono-allencommented, Nov 15, 2019

I created an empty .babelrc in the storybook config directory and it respects my root babel.config.js

4reactions
binarykitchencommented, Feb 8, 2022

Nope, babelModeV7: true didn’t make a difference

Read more comments on GitHub >

github_iconTop Results From Across the Web

Config Files - Babel.js
New in Babel 7.x, Babel has a concept of a "root" directory, which defaults to the current working directory. For project-wide configuration, Babel...
Read more >
npx babel not reading configuration from babel.config.js
I noticed in the npx babel --help it stated that --no-babelrc flag ignores configuration from .babelrc and .babelignore files. Does this suggest ...
Read more >
babel-loader - webpack
This package allows transpiling JavaScript files using Babel and webpack. ... loader in the webpack config (which is not valid anymore as of...
Read more >
Babel Config option | ts-jest - GitHub Pages
You can also use \<rootDir> in the path, or use an absolute path (this last one is strongly not recommended). // jest.config.js module.exports ......
Read more >
Configuration Reference | Vue CLI
vue.config.js is an optional config file that will be automatically loaded by @vue/cli-service if it's present in your project root (next to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found