question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack5 Builder - Stories cannot be explicitly sorted

See original GitHub issue

Describe the bug

I just updated from the Webpack 4 Builder to Webpack 5, and my stories are suddenly sorted differently. Specifically, whereas they used to display in order of export, they now sort alphabetically. In other words, the below code would produce a storybook with Later showing up before MeFirst

// This would show up first
export const MeFirst = ...
// This would show up later, even though L precedes M
export const Later = ...

Looked at the sorting docs, and the objects passed to the storySort option in parameters, but it appears the native export order is not given to this sorting function. Is there any way to have the order of the story exports determine their appearance?

System

  System:
    OS: macOS 12.0.1
    CPU: (10) x64 Apple M1 Pro
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    npm: 7.5.3 - ~/.nvm/versions/node/v12.13.0/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Firefox: 96.0.2
    Safari: 15.1
  npmPackages:
    @storybook/addon-a11y: ^6.4.19 => 6.4.19 
    @storybook/addon-actions: ^6.4.19 => 6.4.19 
    @storybook/addon-essentials: ^6.4.19 => 6.4.19 
    @storybook/addon-links: ^6.4.19 => 6.4.19 
    @storybook/builder-webpack5: ^6.4.19 => 6.4.19 
    @storybook/manager-webpack5: ^6.4.19 => 6.4.19 
    @storybook/node-logger: ^6.4.19 => 6.4.19 
    @storybook/preset-create-react-app: ^4.0.1 => 4.0.1 
    @storybook/preset-scss: ^1.0.3 => 1.0.3 
    @storybook/react: ^6.4.19 => 6.4.19 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rdebeasicommented, Apr 6, 2022

Thanks for your interest! In the future, you can receive updates by clicking the “subscribe” button on the right side of the page. 😄

0reactions
simininocommented, Jun 22, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade to Webpack 5 breaking Storybook 5 - Stack Overflow
The Storybook dev-server builds get cached in a local (to the package where Storybook is installed) node_modules directory (whatever-package/ ...
Read more >
@storybook/builder-webpack5 | Yarn - Package Manager
▶️ Interactive stories to simulate user behavior and tools to debug it; ⚡️ On-demand architecture for smaller builds and faster load times; ⛸...
Read more >
@storybook/builder-webpack5 - npm
Builder implemented with webpack5 and webpack5 -compatible loaders/plugins/config, used by @storybook/core-server to build the preview iframe.
Read more >
Stories are not sorted by their export (in production) #15574
Describe the bug In production, stories are not sorted according to their export instead, they are sorted alphabetically. How they should be sorted...
Read more >
Configuring Storybook: 6 Tips You Can't Miss | by Zheng Li
As it is clearly stated in Storybook documentation: ... If you're looking to change how your stories are ordered, read about sorting stories...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found