Skip to content

HMR does not work for *.js but works for *.jsx #402

@rawasaditya

Description

@rawasaditya

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

See vitejs/vite#14649

I am facing this issue too, there is no support for HMR if react component in written in js file instead of jsx. Not sure if this has to be part of documentation of vite because I think its specific to library like react

Your Suggestion for Changes

Just like here https://vite.dev/guide/troubleshooting.html#a-full-reload-happens-instead-of-hmr we have documentation for cyclic deps

Also there is a github issue linked for server.watch https://vite.dev/config/server-options.html#server-watch

Similarly there has to be documentation for this as well

Reproduction

https://github.com/rawasaditya/vite-hmr-reproduction/tree/main

Steps to reproduce

clone given project

npm i
npm run dev
change App.js to see browser reload

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions