Skip to content

<style> HMR require save twice when exporting a type from a component#13008

Description

@serkodev

Vue version

3.5.13

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-fbpwhbzy?file=src%2Fcomponents%2FFoo.vue

Steps to reproduce

Setup:

  1. Create a Foo.vue component and export a type FooProps.
  2. Add a <style> block in Foo.vue (e.g., setting background-color: red;).
  3. Create a Bar.vue component and import the FooProps type from Foo.vue.
  4. Use both <Foo /> and <Bar /> in App.vue.

Problem:

When running the development server with Vite, changing the background color in Foo.vue, you need to save the file twice for the styles to update in the browser.

What is expected?

After modifying the styles in Foo.vue and saving the file once, the changes should be reflected immediately.

What is actually happening?

The style updates are only applied after saving Foo.vue twice.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vue: ^3.5.13 => 3.5.13

Any additional comments?

I鈥檓 not sure whether this issue is related to Vue or Vite.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions