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

Story Already Exists #3132

Closed
mattrothenberg opened this issue Mar 2, 2018 · 1 comment
Closed

Story Already Exists #3132

mattrothenberg opened this issue Mar 2, 2018 · 1 comment
Labels

Comments

@mattrothenberg
Copy link
Contributor

mattrothenberg commented Mar 2, 2018

Issue details

I'm building out a custom <story> block that can be used in Vue single-file components (SFC) for easier documentation of stories. I've written a custom Webpack loader to parse said blocks and decorate the respective Vue component with some metadata.

https://github.com/mattrothenberg/vue-stories/blob/master/.storybook/story-loader.js#L4-L16

So far, everything works beautifully upon initial load of the Storybook development server. Unfortunately, after every subsequent code change on the Vue side (e.g., changing the case attribute), I get a big honkin' red error saying Story of [story] named [new name] already exists

<template>
  <button class="button-styles" @click="onClick">
    <slot></slot>
  </button>
</template>

<story case="Cool Story, Bro">
  <my-button>Whoa, I'm a story!</my-button>
</story>
import MyButton from './MyButton.vue';
var MyButtonStories = storiesOf('Button', module)

MyButton.__stories.forEach(story => {
  MyButtonStories.add(story.case, () => ({
    components: {MyButton},
    template: story.template
  }))
})

Steps to reproduce

  1. Spin up storybook locally
  2. Change case attribute from Cool story, Bro to Cooler story, Bro
  3. Error!

screen shot 2018-03-02 at 2 05 21 pm

Please specify which version of Storybook and optionally any affected addons that you're running

  • storybook/vue 3.3.14

Affected platforms

All Browsers, as far as I can tell

Screenshots / Screencast / Code Snippets (Optional)

https://imgur.com/QGhkUHF
Repo: https://github.com/mattrothenberg/vue-stories

@mattrothenberg mattrothenberg changed the title [HMR] Story Already Exists Story Already Exists Mar 2, 2018
@Hypnosphi Hypnosphi added the vue label Mar 2, 2018
@mattrothenberg
Copy link
Contributor Author

Upon further inspection, this error stems from my (poorly written) Webpack loader.

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

No branches or pull requests

2 participants