卡住加载反应故事书

时间:2020-05-03 12:20:13

标签: javascript reactjs storybook

我无法启动我的故事书应用。它仅加载加载状态(加载故事)。控制台中没有任何错误。我究竟做错了什么? screenshot

故事书/main.js

const path = require('path')

const autoprefixer = require('autoprefixer')
const lost = require('lost')

const processors = [
  autoprefixer({
    grid: true
  }),

  lost()
]

module.exports = {
  stories: ['../app/ui/**/*.stories.js'],
  webpack: (config) => {
    config.module.rules.push({
      test: /\.scss$/,
      use: [
        'cache-loader',
        'style-loader',
        { loader: 'css-loader', options: { sourceMap: true } },
        {
          loader: 'postcss-loader',
          options: {
            sourceMap: true,

            plugins: (loader) => processors
          }
        },
        { loader: 'sass-loader', options: { sourceMap: true } }
      ],
      include: path.resolve(__dirname, '../')
    })
    return config
  }
}

Button.stories.js (示例组件)

import React from 'react'
import Button from './Button'

export default { component: Button, title: 'Button' }

export const withText = () => <Button>Hello Button</Button>

export const bigSizes = () => (
  <Button
    size='big'
    color='ultra-light-gray'
    borderRadius='big'
  >
    Big grey btn
  </Button>
)

系统:

系统: 作业系统:Windows 10 10.0.18363 二进制文件: 节点:12.14.1-C:\ Program Files \ nodejs \ node.EXE npm:6.13.6-C:\ Program Files \ nodejs \ npm.CMD 浏览器: 边缘:44.18362.449.0 npmPackages: @故事书/反应:^ 5.3.18 => 5.3.18

1 个答案:

答案 0 :(得分:1)

通过将故事书更新到最新版本,这个冲突对我来说消失了。

npx sb@最新升级