storybook: Action logger not working
Describe the bug The action logger is not working
To Reproduce Steps to reproduce the behavior:
- Create a story with action
- Click on the component
- See error
Expected behavior See action log
Code snippets
import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import Button from '.'
storiesOf('Atoms/Button', module).add('default', () => (
<Button onClick={action('clicked')}>Default</Button>
))
System:
- OS: MacOS
- Device: Macbook Pro
- Browser: Chrome
- Framework: React
- Addons: addon-actions
- Version: 5.0.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 36 (16 by maintainers)
I’m also receiving the MetaMask error. I’m realizing it’s a Brave browser issue for me; not sure if others are using the same. I’ve changed the setting under
Extensions -> Web3 provider for using Dappsto “ask” instead of “Crypto Wallets”.I am able to produce it using stock CRA + SB 5.0.1
When viewing the “Hello Button”, click rapidly on it to see error. You have to open the console and click the action multiple times quickly. After this you can move to Button with emoji and it works and then move back to “Hello Button” and it works again.
This happen only the first time.
Dependencies as follow:
BOOM!
I followed the instructions from https://github.com/storybooks/storybook/issues/6004#issuecomment-471451888 post and caught it. It works only at the first boot and only at very fast clicks.
Tomorrow I will investigate this. This is strange.
Thanks @richardtorres314 !
Olé!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.15 containing PR #6240 that references this issue. Upgrade today to try it out!
Because it’s a pre-release you can find it on the
@nextNPM tag.Closing this issue. Please re-open if you think there’s still more to do.
Solved here, the problem was related to MetaMask extension, I just disabled it, why? I don’t know, but its solved 😃
It seems it is crashing when
fast-deep-equalis used to compare two action descriptions ({ name: "...", args: [ ... ] }) to group them. Ifargscontains an event likeMouseEvent, it keeps recursively looping becauseevent.nativeEvent === event.The error will appear on “any” first button you press, then if you navigate to the “other” buttons, it will work fine. And when you cycle back to the first button, it also work fine now. That is how strange it is.