-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Components with mixins are not rendering the props table correctly #152
Comments
In your Since the nuxt.config.js is on the root of your project, I would use import { resolve } from "path";
export default {
components: true,
storybook: {
stories: ["~/components/**/*.stories.mdx"],
addons: [
{
name: "@storybook/addon-docs",
options: {
vueDocgenOptions: {
alias: {
// instead of path.resolve(__dirname, '../') use __dirname
// that would take you in the parent directory of your project... hum
"@": __dirname,
},
},
},
},
"@storybook/addon-controls",
"@storybook/addon-essentials",
],
},
}; |
I'm sorry @elevatebart, this line was copied from another project of mine in which the settings of nuxt.config.js are inside a directory with modularized files. Even changing to your suggestion, the error continues, see: https://codesandbox.io/s/agitated-monad-x8qzw?file=/nuxt.config.js:258-274 |
The expected options should be passed to this preset https://github.com/storybookjs/storybook/blob/master/addons/docs/src/frameworks/vue/preset.ts But here is the list of keys that are logged out for the options (there should be a vueDocgenOptions).
Still investigating, but now this nuxt plugin looks like the right place to do so. |
How is the storybook configuration transmitted to the dev-server? https://github.com/nuxt-community/storybook/blob/master/src/index.ts#L16 This line tends to send a very nuxt specific block to a storybook function, is it picked up later by another tool that adapts it for storybook? Am I missing something? |
I didn't understand your question very well @elevatebart. @farnabaz, can you help us understand what's going on? |
I am wondering how the addon options are meant to be transmitted from Indeed, storybook loaders do not receive the options they are meant to. So vue-docgen-api does not get it either and fails. |
The storybook even receives the options that are passed in Nuxt Config, but mysteriously, the Is this the conclusion that you also reached @elevatebart ? |
Yep exactly |
I'm confused, I don't know if it's a nuxtjs/storybook or storybook bug. @shilman Can you help us investigate this problem as well? |
After trying it out on storybook, I am pretty sure it's a nuxt/storybook bug. |
@elevatebart Have you tested the storybook on a pure Vue project? Do I would like to see more details. Can you create this project on CodeSandbox? I can try to investigate the Nuxt plugin for Storybook more deeply. |
Sorry for the late response. I tried to use Anyway |
All of my Storybook projects have this issue as well when using Mixins from "vue-property-decorator" Storybook version is 6.0.28 |
Hi! I was having this problem from almost one month but now I've finally solved it, I'm not sure what has been the definitive fix, this is what I've done: Storybook 6.1.21 version. Installed in
main.js:
preview.js (I added this line within the rest of the code, which is no revelant due to this issue): My
Also, I needed to import the global SCSS files into every single SCSS which uses variables or mixins. With all of this configuration, I'm finally able to work with Storybook and mixins! |
The I'm not sure the patch will be applied to v6.1.x though. |
Is there anything that needs to be done to make this work? I'm using 6.2.5 with Vue 2 and my mixin props are not showing up still. |
@pocka The issue still persists in |
Version
@nuxtjs/storybook: 3.0.0
nuxt: 2.14.7
Reproduction Link
https://codesandbox.io/s/agitated-monad-x8qzw?file=/nuxt.config.js:258-274
Steps to reproduce
Just await the project starts
What is Expected?
In AwesomeButton, in the Props table, a property called "icon" should appear, which is inside the mixin used by the component.
What is actually happening?
Apparently, the configuration made for the addon @storybook/addon-docs inside nuxt.config.js is not working, as an error message appears in the terminal:
Neither '@/mixins/SomeMixin.vue' nor '@/mixins/SomeMixin.js(x)' or '@/mixins/SomeMixin/index.js(x)' or '@/mixins/SomeMixin/index.ts(x)' could be found in '/sandbox/components'
The text was updated successfully, but these errors were encountered: