简体   繁体   中英

Storybook throwing errors with custom babelrc file

I have project and it is using storybook. It's been upgraded to version 5 of storybook and the project has a .babelrc file in its root.

When running storybook, it will run, but when you use Actions it throws errors - such as unexpected token . I discovered that if the project .babelrc file is removed then storybook loads its default config, this then allows storybook to work as expected.

Storybook can use a .babelrc file from within the storybook folder so that it ignores the root project .babelrc file but what should go into that file so that it either loads the storybook default config or replicates the storybook default config?

Partial solution: This doesn't make storybook load the default .babelrc file/config or copy whatever that may be, but I found that it was the react-hot-loader/babel plugin that was causing the issue.

So I removed that entry from my .babelrc file and storybook with Actions works fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM