-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
action is not sending output to action panel (3.0.0-rc2) #1153
Comments
@smiket Hi Steve, Is the repro public? If so I can take a look!nIf not, does it work with you register the addons in NOTE: I tried to repro myself, but
Then upgrade by hand according to MIGRATION.md |
I also have the same issue, I don't get the action in the logger |
@shilman I updated to the released version (3.0) and everything started working for me. Initially it did not show messages, but I happened to click the link button in the action-logger panel and messages started to display. Not sure if the click had anything to do with it, but all is working for me. Thanks again for following up with me on this - I'm all set now. |
@shilman nope |
@dangreen do you have a public example i could look at? |
@shilman suddenly now all works. |
Well I still have the problem but it might be only a typescript problem. |
@leonidaX do you have a public repo I could look at? |
Sure, the same example that I posted in the typescript issue ticket: https://github.com/leonidax/storybook-ts-less-example |
@leonidaX there was a bug in the code. try: <Button settings={{title: "?" , callback: action("hello")}}/> I'm going to close this for now, but feel free to reopen if you have more issues on this! |
I see thanks :) |
Oh jeez, just wasted a couple hours debugging this after upgrading. Actions don't show up until you click "Action Logger" in the pane. storybook/addon-actions and storybook/react versions 3.0.1. |
Sorry to hear it @nathancahill. Can you explain the problem in more detail? |
Well, it seemed like a CSS issue. However, after wiping node_modules are reinstalling all dependencies, the issue has gone away. So maybe a conflicting storybook file from before. |
Oh jeez, just wasted a couple hours debugging this after upgrading. Actions don't show up until you click "Action Logger" in the pane. |
If the actions tab is empty unless you click to its title, it’s a bug @rkoberg do you have any other addon tabs? Can you take a screenshot of your storybook page when it shows action logger without actions? |
When this happened, the Actions Logger was the only tab. In other words there is no clicking around. Now that I have multiple tabs, I don't see the behavior. The Actions Logger was the first one I tried. Was banging my head why nothing would show. When I saw the post above (that I quoted using bold for some reason), I clicked the title/tab and actions started to show. |
Having same issue with a VUE based project, just installed and totally clean and using the demo files. Clicking the button does nothing. No errors in the console either. |
Having this problem with React now |
The problem seems to be when I believe it is most likely caused when running |
This comment has been minimized.
This comment has been minimized.
i got this error aswell,
|
Actions don't work for me neither...
"react-dom": "^16.4.1", |
Also facing this issue, with no actions being logged. package.json "@babel/cli": "7.0.0-beta.49",
"@babel/core": "7.0.0-beta.49",
"@babel/node": "7.0.0-beta.49",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.49",
"@babel/preset-env": "7.0.0-beta.49",
"@babel/preset-es2015": "7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49",
"@babel/preset-stage-2": "7.0.0-beta.49",
"@reactioncommerce/eslint-config": "1.8.0",
"@storybook/addon-actions": "^4.0.0-alpha.16",
"@storybook/addon-centered": "^4.0.0-alpha.16",
"@storybook/addon-knobs": "^4.0.0-alpha.16",
"@storybook/addon-links": "^4.0.0-alpha.16",
"@storybook/addon-options": "^4.0.0-alpha.16",
"@storybook/addon-viewport": "^4.0.0-alpha.16",
"@storybook/addons": "^4.0.0-alpha.16",
"@storybook/react": "^4.0.0-alpha.16",
"babel-bridge": "^1.12.11",
"babel-core": "^6.26.3", addon.js
|
I resolved my issue by using i did not saw that type of function call anywhere in the doc. i saw it in the code. |
I'm seeing the same as @fadomire. Is this correct? Should we update the documentation? |
I actually bumped into this issue because my MetaMask extension was intercepting the |
I ran into this on action('Button was clicked')() |
@fadomire @Jack-Barry can you please share the particular code examples? The result of calling |
import { storiesOf, Story } from '@storybook/vue'
import { action } from '@storybook/addon-actions'
// @ts-ignore
import MyButton from './MyButton.vue'
const stories: Story = storiesOf('Buttons/MyButton', module)
stories.add(
'Default',
() => ({
components: { MyButton },
methods: {
logAction() {
// action('Button was clicked') <- This doesn't work
action('Button was clicked')() // This does
}
},
template: `
<my-button @click="logAction">
Click Me
</my-button>`
})
) I don't have this project running on the computer I'm at, but the output in the action panel shows |
@Jack-Barry does the following work?
That's how it's used in official vue examples |
That does work, guess I just overlooked the slight difference in how the functions in ...
methods: {
someFunction(someParam) {
// does things with someParam
}
}
... Thanks for pointing that out @Hypnosphi! |
This works for me too. It is almost end of 2020 and sadly still official docs lacks enough examples with vue + TS. Disappointed! |
For me I solved the problem by removing the implementation in my // button.stories.ts
export default {
argTypes: {
onClick: { action: 'clicked' },
}
}
...
interface ArgTypes {
onClick?(e: Event): void;
}
...
// In my case I'm building a design system with Lit and OpenWC, but you get the idea
const Template: Story<ArgTypes> = ({ onClick }: ArgTypes) => html`
<button-component @click=${onClick}></button-component>
`;
...
export const Default = Template.bind({});
Default.args = {
onClick: (e) => { console.log(e) } // <-- ❗Remove this implementation, it's overriding the ArgType Action Handler
}; Turn into this:
After removing the |
Hi,
Thank you for such an excellent tool! I wanted to let you know that after installing 3.0.0-rc2, my actions are not sending output to the action panel. I rimraf'd node_modules to clean everything, then did npm i followed by npm start storybook. Perhaps I have something misconfigured (was all working when I was using kadira/storybook):
In my package.json:
In my config.js:
In my story:
Everything works as expected, except I do not get output in the action logger.
Let me know if you'd like more information -
Thank you,
Steve
The text was updated successfully, but these errors were encountered: