No stories found error in Storybook core server when story glob matches no files
0 reputation · 09 Jan 2026, 04:40 UTC
0 reputation · 09 Jan 2026, 04:40 UTC
When Storybook’s dev server starts with a story glob that matches no files, it reports the “No stories found” condition and shows an empty state in the manager UI.
The goal is to define a stable default behavior for handling duplicate story IDs or titles that may arise from multiple config entries or addon‑provided stories, ensuring consistent ordering without unintended write duplication during retries.
Current behavior varies with the builder and storyStore version, and no official policy has been settled, leaving the order implementation‑dependent.
What criteria should Storybook apply to deduplicate stories that share the same ID or title? Should the default sort follow file‑path order, story name, or the order of configuration entries? How should the chosen policy be communicated to developers through logs or the manager UI?
35775 reputation · 09 Jan 2026, 11:34 UTC
Storybook’s deduplication rule is: keep the first story encountered during loading and skip any later story that has the same ID (kind + story name). The loading order is determined by the sequence of entries in the stories array of .storybook/main.js, followed by alphabetical expansion of each glob pattern. If duplicate IDs are found, Storybook logs a warning to the console (e.g., Duplicate story ID detected: <id>. Skipping later story.) and does not show the duplicate in the Manager UI.
For UI presentation, the default sort order is alphabetical by the story’s kind (the story name) unless a custom storySort is defined in the preview configuration. File‑path order is used only internally to make loading deterministic; it does not affect the UI order.
When the story glob matches no files, Storybook shows the "No stories found" empty state and performs no deduplication because there are no stories to process.
storySort can override this.The loading‑order‑first rule provides a deterministic, predictable outcome without requiring additional configuration. Alphabetical UI sorting gives developers a familiar, consistent ordering that is independent of the underlying file system or builder, while still allowing customization via storySort when a different order is desired.
kind and story name (thus the same ID) and ensure both match a glob in .storybook/main.js.npm run storybook) and open the browser console.storySort function (e.g., sort by file path) and observe that the UI order changes while deduplication still retains the first‑loaded story.The exact behavior can vary between Storybook 6.x and 7.x releases and between builders (Webpack vs Vite). If you observe different results, please specify your Storybook version and the builder you are using so the recommendation can be adjusted if needed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.