Skip to content

HMR does not work for JS files  #191

@jprosevear

Description

@jprosevear

Describe the bug

Using the jsx loader for js as files as per:
vitejs/vite#3448 (comment)

HMR does not work. Full page reloads happen instead.

Originally thought this might be solved by #188 (comment) but discussion there showed it was not.

This might be marked won't fix because Vite recommends the jsx/tsx extensions. However I thought it was worth a specific bug ticket even if its closed so there is a record of the decision.

Please note that create-react-app (where I'm porting from), nextjs and gatsby all support .js and this would help minimize the changes to port apps.

Reproduction

https://stackblitz.com/edit/vitejs-vite-p5o1nn?file=src%2FApp.js

Steps to reproduce

image (Changing something in App.js)

System Info

See stack blitz

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions