Skip to content
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

storyshot/vue3 - Unable to extend vue app with plugins #14655

Closed
freakzlike opened this issue Apr 19, 2021 · 1 comment
Closed

storyshot/vue3 - Unable to extend vue app with plugins #14655

freakzlike opened this issue Apr 19, 2021 · 1 comment

Comments

@freakzlike
Copy link

Describe the bug

When running storyshot with Vue 3 I am not able to install plugins to vue app instance used on initStoryshots(). Installing the plugin in preview.js works fine in storybook and also gets called when running storyshots. But I think storyshots is using another vue app instance.

To Reproduce

  1. Checkout repo: https://github.com/freakzlike/vue3-storyshot-bug
  2. Install dependencies npm install
  3. Run unit tests npm run test:unit

The test should fail with errors.

Expected behavior

The test should succeed without errors.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
  Binaries:
    Node: 12.18.3 - F:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.10.0 - F:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 89.0.4389.128
    Edge: Spartan (44.19041.906.0), Chromium (85.0.564.67)
  npmPackages:
    @storybook/addon-actions: ^6.3.0-alpha.11 => 6.3.0-alpha.11
    @storybook/addon-essentials: ^6.3.0-alpha.11 => 6.3.0-alpha.11
    @storybook/addon-links: ^6.3.0-alpha.11 => 6.3.0-alpha.11
    @storybook/addon-storyshots: ^6.3.0-alpha.11 => 6.3.0-alpha.11
    @storybook/vue3: ^6.3.0-alpha.11 => 6.3.0-alpha.11

Additional context

I have also tested this with Version 6.2.8

The example is running fine in storybook with the installation of the plugin in preview.js.

import { app } from '@storybook/vue3'
import plugin from '../src/plugin'

app.use(plugin)

I also tried to install the plugin within initStoryshots config without success.

initStoryshots({
  config: ({ app }) => {
    app.use(plugin)
    // ...
  }
})

The vue app instance here has already been set correctly from preview.js

@shilman
Copy link
Member

shilman commented Oct 18, 2021

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-beta.14 containing PR #15983 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants