storybook-addon-html icon indicating copy to clipboard operation
storybook-addon-html copied to clipboard

Expecting an HTML snippet or DOM node from the story message with Storybook Vue

Open kimchristiansen opened this issue 3 years ago • 2 comments

If i use the storybook-addon-html in a @storybook/vue i get the following message on each story:

Expecting an HTML snippet or DOM node from the story: "Primary" of "Example/Heading".
Did you forget to return the HTML snippet from the story?
Use "() => <your snippet or node>" or when defining the story.

I use the default @storybook/vue 6.4.9 with vue 2.6.11 and @whitespace/storybook-addon-html 5.0.0

A simplified story look like this, and throws the error:

export const Heading = () => ({
  components: { MyHeading },
  template: '<h1>Heading Test</h1>',
});

If i remove the vue template and rewrite the story to this static return, the error disappears and the html output is working:

export const H1 = () => ('<h1>Heading Test</h1>');

Did i miss something?

kimchristiansen avatar Dec 13 '21 08:12 kimchristiansen

Did you resolve this issue? I'm not actively using Vue so I don't see exactly what the issue is about. Happy to get some help

jeanfredrik avatar Sep 27 '22 08:09 jeanfredrik

No, i sadly did not resolve the issue and used an other storybook.

kimchristiansen avatar Sep 27 '22 08:09 kimchristiansen

Let me know if this is still an issue after upgrading to version 5 of the addon. I will close this for now.

jeanfredrik avatar Nov 14 '22 15:11 jeanfredrik