storybook
storybook copied to clipboard
"Failed to fetch dynamically imported module" when component emits an event with 2 or more arguments
When accessing the story for a component, if the component emits a custom event with 2 or more arguments, it generates the following error:
Failed to fetch dynamically imported module: http://localhost:6006/stories/SecondExample.stories.ts
When trying to access other stories, it may occasionally generate the following error:
[plugin:vite:vue] Element is missing end tag.
PS: There isn't an end tag missing, and the error is caused by the other component (as mentioned in the Vite overlay).
By "2 or more arguments", I mean something like this:
this.$emit('example', 1, 2)
Some things to notice:
- It generates the error when opening the story, even if the event was not emitted.
- It does NOT happen with Composition API (with or without
script setup)
Reproduction
Repository: https://github.com/andresilva-cc/nuxt3-storybook-emit-multiple-args-error
- Clone this repository:
git clone https://github.com/andresilva-cc/nuxt3-storybook-emit-multiple-args-error - Install the dependencies (I'm using yarn):
yarn - Run Storybook through Nuxt or independently:
yarn devoryarn storybook - Access Storybook (probably
http://localhost:6006) - Try to open
FirstExample, it may generate the error "Element is missing end tag", but the other component causes that. If you close Vite overlay, you'll see that the component is visible. - Try to open
SecondExample, it will generate the error "Failed to fetch dynamically imported module" and the component is not being rendered.
I'm getting these same errors. Nuxt works, Storybook works. But this module fails to do anything at all, and only produces errors. 😢
Also, adding this module completely trashes my Nuxt / Vite setup. Instead of serving up my Nuxt site in dev mode, it instead does a development build, which is not what I have configured at all. I don't see anything in the documentation that says that adding this module will force your Nuxt server to run differently and not support dev mode?
Just tried upgrading to v8.0.0. Element is missing end tag. is still showing.
any updates?
Is this problem still present in the most recent version?
Closing this issue due to inactivity :zzz: Please reopen the issue with additional information if the problem persists.