New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of undefined (reading 'id') #16982
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hi! We have the same problem on https://github.com/decathlon/vitamin-web, I just watch this issue :) |
@lauthieb can you tell me how to repro it in vitamin-web? |
Thanks @shilman. Yes for sure! To reproduce (you will need to use yarn):
Then go to http://localhost:6010, you will see our Storybook Vue. It works on " but not on "Docs" tab, we have a white screen with this error: Thanks a lot in advance for your help! 💌 |
Solution found, it's because my file had this format component.mdx instead of components.stories.mdx |
@tibdev78 okay, good news for you!! |
@lauthieb hmm your example is working on my machine -- perhaps it's browser-related? if you can create an isolated repro, that would make it much easier to debug. 🙏 |
@shilman oh that's weird because it doesn't work in production also: https://decathlon.github.io/vitamin-web/@vtmn/showcase-vue/?path=/docs/components-vtmnbutton--overview |
@lauthieb Is it only for statically built storybook? |
@shilman it doesn't work also when I start it in development mode. That's what your question meant? |
I am facing the same issue. It seems that inputs are not being passed correctly, whenever you're intending to import an MDX file into the actual I was able to reproduce the solution by simply changing the names of the files, and Storybook seems to import the MDX file correctly without the error when excluding the I've also figured that the component seems to not be rendered at all, when trying to include an Anyone out there who fixed this? |
The solution for me was to include certain addons instead of relying on My guess is that My main.js:
|
@coderfin you absolute genius! This solved the issue I was seeing too. I'm not sure why this is happening though, looking the I might try update to the latest version (currently on |
Ok for posterity for anyone else that comes across this, when I upgraded to
To this:
|
I am still even facing this issue with Storybook 7.0.18, the following is the setup I am trying to use with a monorepo repository using lerna /** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
stories: [
"../stories/Readme.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
staticDirs: ["./public"],
typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
propFilter: () => true,
},
},
};
export default config; and here is a sample story import { Meta } from "@storybook/blocks";
<Meta title="UI/My UI" />
# My UI Framework
|
I Also Noticed something, if i changed the title value ` to any title while running the storybook in development mode, a new item in the menu appeared and works fine and the old title still remained in the menu with the same issue, but if I stopped the storybook and start it again, the new title only will appear and with the same issue. |
Had similar issue over the last few days trying to upgrade to SB7. (
seems there is still contention around which is correct naming for an intro mdx file:
or
it seemed to switch back and forth throwing the error after running
The 'fix' for me was to run the .stories.mdx to MDX+CSF migration script again which removed the
my main.js
|
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 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
Table.vue
The text was updated successfully, but these errors were encountered: