Closed ptim closed 1 year ago
With 7.0.0-beta.43
, where I checked there's an improved logging:
Error: Error sorting stories with sort parameter (story1, story2) => sort(order, story1, story2);
> sort is not defined
Are you using a V6-style sort function in V7 mode?
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#v7-style-story-sort
at sortStoriesV7 (./node_modules/@storybook/core-server/node_modules/@storybook/preview-api/dist/index.js:36:2333)
at StoryIndexGenerator.sortStories (./node_modules/@storybook/core-server/dist/index.js:10:15604)
at async StoryIndexGenerator.getIndex (./node_modules/@storybook/core-server/dist/index.js:10:15834)
at async ./node_modules/@storybook/core-server/dist/index.js:20:1513
ERROR: "storybook:dev" exited with 1.
ERROR: "storybook" exited with 1.
Anyone else having an issue forcing the sorting function to be inlined and not use anything from outside the function definition?
Yes, the versions 1.x of this package don't work with Storybook 7. I'm working on it. Thanks for the kind words! I'm sorry for the delay.
@gatsbimantico, yes, the limitation of the code usable in preview.js
is exactly what makes the migration difficult. You'd have to inline everything, function and configuration. The only ugly solution that occurred to me is to abuse another Storybook initialisation file, like main.js
, for example, set the data to globalThis
there and then access them from there in storySort
, which is luckily executed later.
Let's continue about this problem and the progress of the migration to the new framework API at the issue #8.
Storybook 7 will be supported by versions 2.x
of this package. Versions 1.x
will remain supporting Storybook 6 and older. The parameter storyStoreV7
opens the door to the new API and its enabling will need a version 2.x
of this package too.
Let's continue about this problem and the progress of the migration to the new framework API at the issue https://github.com/prantlf/storybook-multilevel-sort/issues/8.
👍
Hi!
Thanks for the great plugin! 🙏
FYI, I'm seeing an error when when storybook is configured to use
config.options.storyStoreV7
:When I remove the
storyStoreV7
storybook builds fine.