Skip to content

Storywright fails when storyStoreV7 is enabled #68

@dmytrokirpa

Description

@dmytrokirpa

Steps to Reproduce:

  1. Set up a project using Storybook 7 or higher with the default configuration.
  2. Create a story utilizing the StoryWright decorator.
  3. Build the Storybook.
  4. Execute StoryWright.

Actual Result:

StoryWright fails, producing the following output:

$ storywright  --browsers chromium --url dist/storybook --destpath dist/screenshots --waitTimeScreenshot 500 --concurrency 4 --headless true
================ StoryWright params =================
Storybook url = file:////.../dist/storybook
Screenshot destination path = dist/screenshots
Browsers = chromium
Headless = true
Concurrency = 4
Cores available on system  = 16
SkipSteps = false
WaitTimeScreenshot = 500
Parse DOM = false
Compress DOM = false
================ Starting story right execution =================
StoryWright processor started @  2024-07-25T13:04:40.569Z
Starting browser test for chromium
** ERROR ** Error: page.evaluate: Error: extract called before initialization
    at StoryStore.extract (file:///.../dist/storybook/sb-preview/runtime.js:47:11685)
    at StoryStore.raw (file:///.../dist/storybook/sb-preview/runtime.js:47:13415)
    at ClientApi.raw (file:///.../dist/storybook/sb-preview/runtime.js:79:408)
    at eval (eval at evaluate (:226:30), <anonymous>:1:28)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:226:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)
Closing process !!
StoryWright took  0 secs to complete.
StoryWright processor completed @  2024-07-25T13:04:40.959Z

Opting out of on-demand story loading somewhat works, although it is not a default setting and it's not documented in StoryWright documentation.

Expected Result

StoryWright should successfully capture screenshots for stories using a standard Storybook v7+ configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions