Closed kevinvalk closed 11 months ago
@chakAs3 do you know what might be happening here?
Hi @kevinvalk, have ever used JSX in Vue?
if the case is the same in Storybook, the render function returns a Vue component, so if you use JSX or render functions, you can't use the template
option you need to use the setup
function and return your JSX expression
here is a repo that shows different render function https://github.com/storybook-vue/storybook-vue-custom-render.git
O wow, I completely misunderstood the warning runtime.js:94 [Vue warn]: Component is missing template or render function.
. Indeed this is a user error.
That said, I am confused about the type of template
as (according vue internals) it is an template?: string | object
field. Hence I do not get any "errors" that I am not using a string and it happily accepts JSX or h(). To protect against user errors, maybe it is something to be checked. But it is not the responsibility of storybook to do that....
Regardless, thanks for the help, closing!
What version of
vite
are you using?vite/4.3.9 darwin-arm64 node-v18.16.1
System info and storybook versions
Describe the Bug
Using JSX syntax in stories causes Storybook to render no output and emit a console warning
Link to Minimal Reproducible Example
https://github.com/kevinvalk/problem-storybook-vite-vue3-jsx
Participation