-
Notifications
You must be signed in to change notification settings - Fork 33
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 property 'name' of undefined #33
Comments
Seeing the same issue; initial appearances are that it's the interaction of this addon with Here's my relevant "storybook-addon-vue-info": "^1.1.1",
"storybook-vue-router": "^1.0.3", Most importantly, in my component, when I remove the use of Investigating, but not certain I'm gonna get anywhere in terms of a fix... 🤔 |
experiencing exactly the same problem reported by @jackkoppa . At the moment I'm resigned to avoid using the info addon where I need the router, but it's definitely something related to the interaction with each one. |
Hi @ThePeach, @Moonhint - I thought I responded earlier here. I have a decent solution, after some experimenting: move But, it does mean that you can use this addon, with the router addon, and your stories will function well. So:
import { configure, addDecorator } from '@storybook/vue'
// begin important part
import { withInfo } from 'storybook-addon-vue-info';
import withRouter from 'storybook-vue-router'
addDecorator(withInfo)
addDecorator(withRouter())
// end important part
function loadStories() {
// Dynamically requires any .js file inside of the
// stories directory
const stories = require.context('../src/stories/', false, /\.js$/)
stories.keys().forEach(stories)
}
configure(loadStories, module)
stories.add(
'Some story name',
() => {
// Implement the story
},
{
info: { summary: 'My sample summary' }
}
) |
@jackkoppa thanks for the clarification! loading the router after info works, odd behaviour perhaps but this seems to fix it and make them work together. 🙇 🎉 👍 |
Issue:
Which version are you using? 1.0.3
Are you using storybook-router with a react based project or a vue one? with vue
Please describe the problem:
After add this to my story, I found this Cannot read property 'name' of undefined error.
Please explain how to reproduce the issue or (better) provide an example to do it.
Here how I add it:
The text was updated successfully, but these errors were encountered: