-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: 7.6.4 - Module '"@storybook/addon-actions/decorator" "Type 'unknown' cannot be assigned to type 'StoryFnHtmlReturnType'" #25170
Comments
Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! 🙏 |
Yeah i can provide it, i need few hours thanks. But investigated the problem, i think is the same here: #22384 But with the @storybook/html plugin and not /react Type '(storyFn: PartialStoryFn<T, Args>) => T["storyResult"]' is not assignable to type
|
Hi there! Thank you for opening this issue, but it has been marked as |
I'm facing the same issue with storybook v7.6.10 and able to replicate it in the v8.0.0-alpha.13. Seems to be happening after PartialStoryFn type is copied from Reproduction repo here: |
Also ran into this. In every story with
History: While trying to fix a bug about a missing From what I can tell, the issue is that I've found two ways to avoid the error:
decorators: [withActions<HtmlRenderer>]
import { withActions as withActionsOriginal } from '@storybook/addon-actions/decorator';
const withActions: <T extends Renderer>(
storyFn: PartialStoryFn<T>
) => T['storyResult'] = withActionsOriginal; I don't understand how 2 is any different than doing nothing, but it works. |
# Pull Request ## 🤨 Rationale Wanted to see if there were any improvements. ## 👩💻 Implementation - Bumped version from 7.4.0 to 7.6.13 - Had to work around an [issue](storybookjs/storybook#25170) related to the typing of `withActions` decorator of actions add-on. ~~Re-exporting `withActions` from our Storybook utilities file with a type that works (based on [comment in related issue](storybookjs/storybook#22384 (comment) Now providing type argument to generic `withActions` function. - Marked docs support disabled in `addon-essentials` since we import that addon separately (`addon-docs`) so we can configure it. Not sure if this improves anything, but it doesn't seem to hurt. - Also fixes #1639 ## 🧪 Testing Ran Storybook. `npm run storybook` seems to get everything ready about 25% faster (40s -> 30s). ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
@m-akinc I can not reproduce this in the latest v8 release:
|
For people running into this and searching a workaround in a WebComponents project, the correct generic type is: |
@kasperpeulen Looks like it is fixed in the 8.0.0 release. Great! |
@m-akinc Thanks for checking! |
Describe the bug
I´ve migrated storybook addons to latest version 7.6.4 and the decorator wihtActions have been broken by the update, and can´t compile the storybook.
It looks like the last version broke the package.
To Reproduce
It reproduces with version 7.6.4 of @storybook/addon-actions/decorator, but not with 7.5.X of less.
System
Additional context
No response
The text was updated successfully, but these errors were encountered: