storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.18k stars 9.26k forks source link

Preview not reloading when Vue 2 component template changes #16033

Closed Soviut closed 1 year ago

Soviut commented 3 years ago

Describe the bug

I have a simple Vue 2 single file component (SFC). I'm using the Vue 2 Composition API to define the component in the <script> portion of the SFC. I'm also using Typescript.

<template>
  <!-- changing any of this does not trigger HMR -->
  <div>
    testing
  </div>
</template>

<script lang="ts">
import { defineComponent } from '@vue/composition-api'

export default /*#__PURE__*/ defineComponent({
  setup() {
    console.log('ding') // changing this triggers HMR
  },
})
</script>

When code in the <script> changes, webpack rebuilds, HMR is triggered in the browser, the preview reloads.

image

image

However, when changing the <template>, webpack rebuilds, the HRM triggers, but the preview does not reload.

image

To Reproduce

Got the following error trying to make a repro

🧶 Installing Yarn 2
yarn set version berry && yarn config set enableGlobalCache true && yarn config set nodeLinker node-modules
An error occurred while executing: `yarn set version berry && yarn config set enableGlobalCache true && yarn config set nodeLinker node-modules`
Command output was:
yarn run v1.16.0
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

warning ../package.json: No license field
error Command "set" not found.

🚨 Installing Yarn 2 failed
🚨 Failed to create repro

System

  System:
    OS: Linux 4.19 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
  Binaries:
    Node: 16.7.0 - ~/.nvm/versions/node/v16.7.0/bin/node
    Yarn: 1.16.0 - /mnt/c/Users/Ian/AppData/Roaming/npm/yarn
    npm: 7.20.3 - ~/.nvm/versions/node/v16.7.0/bin/npm
  npmPackages:
    @storybook/addon-actions: ^6.3.8 => 6.3.8 
    @storybook/addon-essentials: ^6.3.8 => 6.3.8 
    @storybook/addon-links: ^6.3.8 => 6.3.8 
    @storybook/vue: ^6.3.8 => 6.3.8 

Additional context Add any other context about the problem here.

shilman commented 1 year ago

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if: