Storybook: Error: Manager build is broken

Created on 24 Mar 2019  路  5Comments  路  Source: storybookjs/storybook

Describe the bug

I am trying to add Storybook middleware to my web server. When upgrading to 5.0.x and making some necessary adjustments, the Storybook build and standalone server work, but I am receiving an error trying to create the middleware.

To Reproduce

This is the helper function I'm using to obtain the Storybook router.

// @flow
// middleware.js
import storybook from '@storybook/core/dist/server/dev-server'
import path from 'path'

export default function createStorybookMiddleware () {
  const configDir = path.resolve(__dirname, 'src')

  return storybook({
    configDir,
    output: { publicPath: '/storybook/' },
    publicPath: '/storybook/',
    ignorePreview: true,
    debugWebpack: true
  })
}

Expected behavior
I would expect that I am able to get a reference to the router and use it in my web server.

Screenshots

image

System:

  • OS: Arch Linux
  • Framework: react
  • Addons: actions, centered, info, knobs, notes, storysource, viewport
  • Version: 5.0.3
bug core

Most helpful comment

Would appear I was actually missing some Storybook packages. After adding everything there was a small error for the preview build. This is the setup I have now that's working:

// @flow
// middleware.js
import storybook from '@storybook/core/dist/server/dev-server'
import path from 'path'

export default function createStorybookMiddleware () {
  const configDir = path.resolve(__dirname, 'src')

  return storybook({
    configDir,
    output: { publicPath: '/storybook/' },
    publicPath: '/storybook/',
    packageJson: require('./package.json')
  })
}

All 5 comments

It could possibly be connected with wrong "latest" tag on npm release. I think it is erroneously set to 3.4.12 instead of 5.0.4

Thanks for the heads up! I'll take a look at my lockfile to see if there's anything older pulled in by accident :female_detective:!

I upgraded to v5.0.5 and can confirm from my lockfile that all the dependencies are also on v5.0.5. Still receiving Error: Manager build is broken with { error: null }.

@ndelangen Any known changes to middleware in 5.0?

Would appear I was actually missing some Storybook packages. After adding everything there was a small error for the preview build. This is the setup I have now that's working:

// @flow
// middleware.js
import storybook from '@storybook/core/dist/server/dev-server'
import path from 'path'

export default function createStorybookMiddleware () {
  const configDir = path.resolve(__dirname, 'src')

  return storybook({
    configDir,
    output: { publicPath: '/storybook/' },
    publicPath: '/storybook/',
    packageJson: require('./package.json')
  })
}
Was this page helpful?
0 / 5 - 0 ratings