storybookjs/vue-cli-plugin-storybook

Support for storybook v6.5.9 and v7 syntax

adambullmer opened this issue · 0 comments

Describe the bug

This probably also merits a fix to figure out if @storybook/core/server or @storybook/core-server is available as a dependency to require. The relevant dummy patch has been added to the reproduction steps.

I expect this to be an issue with bleeding edge use cases, but believe this will be a bigger problem when storybook releases their first V7 release. Using the new-ish storyStoreV7 feature flag while using this vue-cli plugin isn't yielding a running storybook server. The builder will succeed, however the storybook preview window will have the following full screen error:

Expected your framework's preset to export a \`renderToDOM\` field.

  Perhaps it needs to be upgraded for Storybook 6.4?
  More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field

Steps to reproduce the behavior

  1. Setup fresh project with this vue-cli plugin
  2. Ensure first party vue-cli plugin versions are all below v5 (5+ will require webpack 5) (this may also require deleting the scaffolded vue.config.js file that was created for vue-cli 5+)
  3. Upgrade storybook and storybook plugin versions to 6.5.9
  4. Make patch to this item's lib/index.js to import @storybook/core-server instead of @storybook/core/server
  5. Add to your storybook/main.js config the following root level option features: { storyStoreV7: true, buildStoriesJson: true }
  6. Run the storybook:serve command
  7. Observe error in storybook preview window

Expected behavior

I expect the storybook site to be able to successfully run the storybook server.

Screenshots and/or logs

n/a, Whole error text has been copied in description

Environment

  • OS: MacOS Monterey v12.4
  • Node.js version: v14.20.0
  • Yarn version: v3.2.2
  • Vue version: v2.6.14

Additional context

Storybook Feature Flags documented here: https://storybook.js.org/docs/react/configure/overview#feature-flags