Skip to content
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

Angular: StoryStoreV7 breaks components with decorators #18600

Closed
adrilolo9 opened this issue Jun 29, 2022 · 4 comments
Closed

Angular: StoryStoreV7 breaks components with decorators #18600

adrilolo9 opened this issue Jun 29, 2022 · 4 comments

Comments

@adrilolo9
Copy link

Describe the bug
After enabling the storyStoreV7 feature, stories that use decorators break, leaving an undefined message replacing the component.

To Reproduce

  • Enable storyStoreV7
  • Add a decorator to a story, example: decorators: [componentWrapperDecorator((story) => <div style="margin: 3em">${story}</div>)]
  • Make sure the story does NOT have any template, so it uses the component.
    image

Additional context
The story parameter of the decorator becomes undefined when turning storyStoreV7 on, so you are left with an undefined message.
image

@tmeasday
Copy link
Member

Hi @adrilolo9

Please create a reproduction by running npx sb@next repro and following the instructions. Read our documentation to learn more about creating reproductions. Paste your repository and deployed reproduction here. We prioritize issues with reproductions over those without.


Also, what framework/renderer is this? Your story function looks like maybe it is using Angular but the decorator looks like React?

@DavidDudson
Copy link

Our company also getting the same issue.

turning storyStoryV7 on in an angular 6.5.12 project, with a decorator such as

componentWrapperDecorator(
      story => `<div style="margin: 5em; background-color: #ffffff; display: inline-block">${story}</div>`
)

results in story being undefined.

@DavidDudson
Copy link

Turns out this is a duplicate of #17330 and there is a fix is here: 23a3438

Because its not in the 6.X line, the best solution is to use patch-package to patch this.

@tmeasday This can probably be closed as a duplicate

@tmeasday
Copy link
Member

OK, thanks @DavidDudson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants