whitespace-se / storybook-addon-html

A Storybook addon that extracts and displays compiled syntax-highlighted HTML
Other
95 stars 43 forks source link

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

Closed kimchristiansen closed 1 year ago

kimchristiansen commented 2 years ago

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?

jeanfredrik commented 1 year ago

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

kimchristiansen commented 1 year ago

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

jeanfredrik commented 1 year ago

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