Skip to content

storybook build not exiting #34446

@Profesor08

Description

@Profesor08

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch storybook@10.3.4 for the project I'm working on.

When storybook build runs, it not exiting after build is done

Image

Here is the diff that solved my problem:

diff --git a/node_modules/storybook/dist/bin/core.js b/node_modules/storybook/dist/bin/core.js
index 2e10e85..c38bb6b 100644
--- a/node_modules/storybook/dist/bin/core.js
+++ b/node_modules/storybook/dist/bin/core.js
@@ -2828,6 +2828,7 @@ command("build").option("-o, --output-dir <dir-name>", "Directory where to store
   }).catch(() => {
     logger2.outro("Storybook exited with an error"), process.exit(1);
   }), logger2.outro("Storybook build completed successfully");
+  process.exit(0);
 });
 command("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (options) => {
   let { env } = process;

This issue body was partially generated by patch-package.

{
  "scripts": {
    "build:storybook": "storybook build --output-dir .storybook-static --disable-telemetry",
    "storybook": "storybook dev -p 6006 --no-open --no-version-updates",
  },
  "devDependencies": {
    "@storybook/addon-docs": "^10.3.4",
    "@storybook/nextjs-vite": "^10.3.4",
    "storybook": "^10.3.4",
  },
}
import type { StorybookConfig } from "@storybook/nextjs-vite";

const config: StorybookConfig = {
  stories: ["../src/ui/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
  addons: ["@storybook/addon-docs"],
  framework: "@storybook/nextjs-vite",
  staticDirs: [],
  core: {
    disableTelemetry: true, // 👈 Disables telemetry
    disableWhatsNewNotifications: true,
  },
  docs: {
    defaultName: "Documentation",
  },
};

export default config;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions