storybook: npx sb extract not working as expected

Describe the bug Running npx sb extract results in the following error:

npx sb extract
info connecting to: http://localhost:57011/iframe.html
info installing puppeteer...
TimeoutError: waiting for function failed: timeout 30000ms exceeded
    at new WaitTask (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/puppeteer-core/lib/DOMWorld.js:549:28)
    at DOMWorld.waitForFunction (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/puppeteer-core/lib/DOMWorld.js:454:12)
    at Frame.waitForFunction (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/puppeteer-core/lib/FrameManager.js:657:28)
    at Page.waitForFunction (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/puppeteer-core/lib/Page.js:1141:29)
    at read (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/@storybook/cli/dist/extract.js:30:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async extract (/Users/rniznik/.npm/_npx/37097/lib/node_modules/sb/node_modules/@storybook/cli/dist/extract.js:87:18)

To Reproduce Steps to reproduce the behavior:

  1. Go to a Storybook project
  2. Run npx sb extract from the terminal

Expected behavior The command runs and creates a stories.json file.

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 87.0.4280.88
    Edge: 87.0.664.66
    Firefox: 84.0.1
    Safari: 14.0.2
  npmPackages:
    @storybook/addon-a11y: ^6.1.11 => 6.1.11 
    @storybook/addon-actions: ^6.1.11 => 6.1.11 
    @storybook/addon-controls: ^6.1.11 => 6.1.11 
    @storybook/addon-docs: ^6.1.11 => 6.1.11 
    @storybook/addon-storysource: ^6.1.11 => 6.1.11 
    @storybook/addon-viewport: ^6.1.11 => 6.1.11 
    @storybook/addons: ^6.1.11 => 6.1.11 
    @storybook/react: ^6.1.11 => 6.1.11 
    @storybook/source-loader: ^6.1.11 => 6.1.11 
    @storybook/theming: ^6.1.11 => 6.1.11 
    @storybook/web-components: ^6.1.11 => 6.1.11 

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

the way to solve this issue is to override puppeteer-core in the package.json with version 13.7.0

I’m using pnpm so it will be


  "pnpm": {
    "overrides": {
      "puppeteer-core": "^13.7.0",
    }
  },

you can use resolutions in case of yarn, npm

I’m on v6.4.13 and am getting this error. I’m not opted in to v7 store mode.

Ran into the same issue. Strangely I resolved it by calling sb extract from the root of the repository with the dist folder as a parameter:

npx sb extract dist/storybook/your-lib/

This strangely worked in opposite to cd dist/storybook/your-lib/ && sb extract in my case.

I am on 7.1.0 and I am still facing this issue.