storybook: Cannot read properties of undefined (reading 'id')
Hi everyone, I’m using @storybook/vue to make my storybook and I’m trying to embed a view component in my mdx files but I get these errors: “Cannot read properties of undefined (reading ‘id’)” and “The above error occurred in the <Canvas> component”. I’ve been looking for a solution on different forums but I can’t find it. Does anyone have a solution?
my code : button.docs.mdx
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import Table from "@/stories/stories-component/Table.vue";
<Meta title="Bootstrap Custom Button Documentation" />
# Test
<Canvas>
<Story name="test table">
{() => {
return {
components: { Table },
template: `<Table></Table>`
};
}}
</Story>
</Canvas>
Table.vue
<template>
<p>test component </p>
</template>
<script>
export default {
name:"Table",
props: {}
}
</script>
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 13
- Comments: 18 (8 by maintainers)
Thank you for the information that helped resolve this problem. I had installed many add-ons that caused conflicts. I kept only the essential ones, and then the problem was resolved.
The solution for me was to include certain addons instead of relying on
@storybook/addon-essentials.My guess is that
@storybook/addon-essentialsconfigures the addons with different defaults than the individual addons or there is some sort of race condition that is resolved by including the addons individually. I’m not really sure.My main.js:
@tibdev78 okay, good news for you!! For us, we only have
xxx.stories.jsfiles so I think it’s still not working 😦Solution found, it’s because my file had this format component.mdx instead of components.stories.mdx