storybookjs / test-runner

🚕 Turn stories into executable tests
https://storybook.js.org/docs/writing-tests/interaction-testing
MIT License
233 stars 72 forks source link

[Bug]: Found 1 unhandled error while running the play function -- Error: null #507

Open unional opened 2 months ago

unional commented 2 months ago

Describe the bug

I notice this error occurs when I'm running tests from time to time.

    page.evaluate: StorybookTestRunnerError: 
    An error occurred in the following story. Access the link for full output:
    http://localhost:6031/?path=/story/inputs-select--pop-upward&addonPanel=storybook/interactions/panel

    Message:
     null

It doesn't fail all the time. It is probably related to load and timing.

I tried to repro it directly, and I'm able to do that after I click remount component many times:

image

image

I notice that I don't need to click to very quickly. I'm able to repro the issue by clicking at the rate around 0.7 sec, and the failure occurs from 10 to 50 clicks.

To Reproduce

Cannot repro with simple button. I suspect this involves some re-render/listener/observer. The story I have is a simple Select component from react-aria-components which involves Popover (i.e. Portal).

Will see if I can create a repro later on.

System

Storybook Environment Info:

  System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v20.12.2/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm <----- active
    pnpm: 8.15.6 - ~/.nvm/versions/node/v20.12.2/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.85
    Safari: 17.6

Additional context

No response

filipw01 commented 1 week ago

I have the same error after updating react-aria in a repo. Digging deeper now

filipw01 commented 1 week ago

I didn't find the root cause, in the end silenced with parameters.test.dangerouslyIgnoreUnhandledErrors in story default export set to true