storybook: [Bug]: TypeError: Cannot read properties of undefined (reading 'count') with onClick action
Describe the bug
To Reproduce
just setup a react app with webpack or vite, then install storybook and create a story for a single button component
System
Environment Info:
System:
OS: macOS 13.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 18.13.0 - ~/.nodenv/versions/18.13.0/bin/node
Yarn: 1.22.19 - ~/.nodenv/versions/18.13.0/bin/yarn
npm: 9.6.7 - ~/.nodenv/versions/18.13.0/bin/npm
Browsers:
Chrome: 115.0.5790.170
Safari: 16.6
npmPackages:
@storybook/addon-essentials: ^7.2.1 => 7.2.1
@storybook/addon-interactions: ^7.2.1 => 7.2.1
@storybook/addon-links: ^7.2.1 => 7.2.1
@storybook/addon-onboarding: ^1.0.8 => 1.0.8
@storybook/blocks: ^7.2.1 => 7.2.1
@storybook/react: ^7.2.1 => 7.2.1
@storybook/react-webpack5: ^7.2.1 => 7.2.1
@storybook/testing-library: ^0.2.0 => 0.2.0
Additional context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 16
- Comments: 20 (10 by maintainers)
Commits related to this issue
- bugfixes - issue still open: https://github.com/storybookjs/storybook/issues/23787 — committed to cluetec/ngcx-tree by mn-42 10 months ago
Just updated to Storybook 7.4.0 and I’m still seeing this error. After a manual reload of Storybook, any action that’s tracked by the Actions addon starts throwing this error again, until I switch to a different story. Exact same problem as before.
I have the same error, here are my remarks:
So - from my understanding - it means, the error happens when clicking button right after on page load and not when we re-render 🤔
@ndelangen here’s what I learned when trying to reproduce:
Here’s a repro: https://stackblitz.com/edit/github-iz1qiv?file=src%2Fstories%2FButton.stories.ts
Because you can’t reload the page in stackblitz, you’ll need to download the project and run locally.
Fixed in latest alpha release by https://github.com/storybookjs/storybook/pull/23804
Same, downgrading
@storybook/addon-essentials
to 7.1.1 fixes it.We’re facing the same issue :
Cannot read properties of undefined (reading 'count')
when we click on a checkbox before clicking in any other field on the page.for me it happens whenever I trigger the assigned action, e.g. click the button.