-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fast refresh not working properly with MDX #34212
Comments
x-ref: #31827 x-ref: #34212 ![image](https://user-images.githubusercontent.com/1365881/151994766-b9afb349-1a9a-4220-9387-de10165e34e3.png) ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` Co-authored-by: JJ Kasper <[email protected]>
I am also experiencing the same issue. |
I'm noticing that this only happens when an MDX file has a named export. For example: export const meta = {
title: 'hello'
}
# some heading
lorem ipsum... It doesn't seem to have a problem with an MDX file that contains a default export (layout). |
Yep, noticing the same issue:
And like @trevorblades mentioned, Fast Refresh doesn't have to perform a full reload as soon as I remove the named exports. But now the styles do not hot-update 🤔 |
Run
next info
(available from version 12.0.8 and up)What version of Next.js are you using?
v12.0.10 (replicated on v12.0.11-canary.12)
What version of Node.js are you using?
17.2.0
What browser are you using?
Chrome
What operating system are you using?
macOS Monterey
How are you deploying your application?
N/A (reproducible in dev mode)
Describe the Bug
Per suggestion from @ijjk in #31827, I created a simple repo based on a small modification to the official "with MDX" example to demonstrate how "Fast refresh" is not working properly at times, as it and keeps triggering the big, blocking "About to perform a full refresh" warning panel.
The repo is a simple blog example, with one single post in MDX format.
Whenever I make a modification to the MDX file, I would expect auto-refresh to kick in and Chrome to display my modification. In almost all situations (but not always), it displays a big warning instead. While I can click on the "Reload" button, this is definitely creating friction (but an option to disable that big warning panel would be great too).
Expected Behavior
I would expect simple saving the file in my
pages/
directory to automatically re-compile and refresh it in Chrome without warning, as opposed to displaying the big panel.To Reproduce
Here is the repo:
https://github.com/sebastienbarre-forks/next.js-examples-with-mdx
To reproduce:
npm run dev
in a terminal=> the "About to perform a full refresh" should appear. It doesn't always, but more often than not it does, and certainly when I have just re-run
npm run dev
.Here is a video capture:
fastrefreshissue.mov
The text was updated successfully, but these errors were encountered: