Open cap-anna opened 1 month ago
Disclaimer This information might be inaccurate, due to it being generated automatically
To resolve the issue, ensure that the renderToCanvas
function is exported in the @storybook/html-vite
framework preset. This function is likely located in the /code/renderers/html/src/client/preview/render.ts
file. Add the following export if it is missing:
export function renderToCanvas({ storyFn, showMain, showError, forceRemount }) {
// Implementation of renderToCanvas
}
Then, ensure that the preset.js
file in /code/renderers/html
includes this export:
module.exports = {
renderToCanvas: require('./dist/render').renderToCanvas,
};
/code/core/src/preview-errors.ts /code/lib/cli/src/automigrate/fixes/new-frameworks.ts /code/core/src/telemetry/storybook-metadata.test.ts /code/core/src/server-errors.ts /code/lib/cli/src/automigrate/fixes/addon-postcss.ts /code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts /code/core/src/preview-api/modules/store/csf/prepareStory.test.ts /code/.storybook /code/lib/cli/src/generators/configure.test.ts /code/lib/cli/src/automigrate/fixes/cra5.ts /code/addons/onboarding/package.json /code/frameworks/html-webpack5 /code/core/src/csf-tools/ConfigFile.test.ts /code/lib/cli/src/automigrate/index.test.ts /code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts /code/renderers/svelte/src/portable-stories.ts /docs/addons/addon-migration-guide.mdx /code/lib/cli/src/automigrate/fixes/prompt-remove-react.ts /docs/_snippets/web-components-vite-add-framework.md /docs/_snippets/svelte-vite-add-framework.md /code/renderers/html /code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/forms.stories.js /test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts /docs/_snippets/main-config-core-enable-crash-reports.md /code/lib/cli/src/automigrate/fixes/vue3.ts
Hi, thanks for reporting this. do you have a reproduction repo you can share? If not, can you please create one via storybook.new? We prioritize bug reports that have reproduction. Thank you! 🙏
Describe the bug
Hi there, I have just upgraded my stencil.js repository, which uses storybook, from 7 to 8.
When I locally start storybook, I do not get any console errors. However the browser does not render any stories but give the error "Expected your framework's preset to export a
renderToCanvas
field.".The framework I am using is html-vite. Dependencies can be seen in system section.
main.ts in storybook folder
vite.config.ts
manager.ts
Additional context
No response