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
fix(addon-docs): support nuxt context in docs canvas #124
Conversation
I found a second issue, which is probably related to this one. It seems like assets (fonts, scss, ...) are not being loaded when you navigate to a components docs section directly eg. http://localhost:4000/?path=/docs/typography--preview Currently, you have to open the Canvas section first and then select the Docs section in order for assets to be loaded |
It seems that the storybook does not load the entry file on the situation you are explained. |
storybook/preview.js
Outdated
const el = React.useRef(null) | ||
// FIXME: This recreates the Vue instance every time, which should be optimized | ||
React.useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only way to fix and listen for ? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how docs addon work.
I don't see any workaround to refactor the code.
Is there any workaround about this? Thank you! |
@mariomka Do you have a problem using the latest version? If so please provide a reproduction sample for it. |
@farnabaz Yes, I have a problem using the last version I hope I have time this weekend to provide a reproduction. |
@farnabaz I found the root of the problem, it happens when you add custom configuration files ( Reproduction repo: https://github.com/mariomka/nuxt-storybook-docs-assets-issue Just clone, install yarn dependencies, run storybook, and visit http://localhost:3003/?path=/docs/customtext--text directly, then go to the Canvas tab. You can checkout the previous commit to seeing how it works well without custom configuration files. |
@farnabaz have you been able to take a look? |
Thank you @farnabaz! Today I've was updating it and trying it, and now styles load well but fonts still don't load until you open the canvas tab. I've updated the reproduction repo with the new version. |
@mariomka Sorry for the late response. Could you create an issue for it and a sample reproduction project? |
Types of changes
Description
override
prepareForInline
in order to render stories inside docs canvas with nuxt contextclose #121
Checklist: