storybookjs/vue-cli-plugin-storybook

Requiring unspecified peer dependency

Closed this issue · 2 comments

Describe the bug

When using yarn 2 (which has very strict module resolution), builds will error because this package references @storybook/core. This is both not installed by the default scaffold ^6.0.0 nor is it listed as a peer dependency of this package.

Steps to reproduce the behavior

  1. Scaffold new vue app vue create . and follow prompts
  2. Add this plugin vue add storybook and use ^6.0.0 as the version
  3. Bump yarn version yarn set version berry
  4. yarn install
  5. yarn build
  6. Observe error.

Expected behavior

I expect a default vue project, adding this plugin's generated code, and a build to succeed without failure.

Screenshots and/or logs

Error: vue-cli-plugin-storybook tried to access @storybook/core, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Environment

  • OS: OSX 10.15.7
  • Node.js version: v14.12.0
  • NPM version: yarn 2.2.2
  • Browser (if applicable): n/a
  • Browser version (if applicable): n/a
  • Device (if applicable): n/a

Additional context

This is also incompatible with vue3, but will make a separate issue

Let's add it as a peer dependency then. Along with @storybook/vue

You might need to also list vue as a peer dependency. Seems in a monorepo setting it may be required