#2444·mdx

react hmr (fast refresh) breaks when deleting all content of a mdx file

Author: csr632Created Feb 24, 2024Updated Mar 6, 2024
Labels🐛 type/bug🗄 area/interface👶 semver/patch🤞 phase/open

Initial checklist

Affected packages and versions

3.0.1

Link to runnable example

https://stackblitz.com/edit/vitejs-vite-sorj9w?file=src%2Ftest.mdx,vite.config.ts&terminal=dev

Steps to reproduce

  1. Go to https://stackblitz.com/edit/vitejs-vite-sorj9w?file=src%2Ftest.mdx,vite.config.ts&terminal=dev (run npm run dev if it is not auto run)
  2. Delete all content of test.mdx
  3. The app is broken after hmr: image

Expected behavior

The app should not be broken.

Actual behavior

The app is broken.

Runtime

Node v20

Package manager

npm v10

OS

macOS

Build and bundle tools

Vite