Document Fast Refresh requirements and troubleshooting
See original GitHub issueBug report
Describe the bug
Fast refresh is not working when using named exports alongside default export.
To Reproduce
- Setup new next project using next init
- Go to
pages/index.js
and remove export default from your function component
export default function Home() {...}
// to
function Home() {...}
- export something alongside your component as default
// end of the file
let a = 2;
export { a, Home as default};
Expected behavior
Fast refresh should work
System information
- OS: Linux
- Browser Chromium latest
- Version of Next.js: 9.4.1
- Version of Node.js: 12.16.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Basic Features: Fast Refresh - Next.js
Next.js' Fast Refresh is a new hot reloading experience that gives you instantaneous feedback on edits made to your React components.
Read more >How To Troubleshoot Materialized View Fast Log Timestamp ...
Purpose · Troubleshooting Steps · 1./ Verify that Fast refresh is being used · 2./ What type of fast refresh is running? ·...
Read more >Materialized View Fast Refresh Performance Tips
A materialized view that is verified to be fast refresh should update relatively fast. But what happens when there are few changes to...
Read more >Fast Refresh | Gatsby
Fast Refresh is an implementation of Hot Reloading with full support from React. It replaces unofficial solutions like react-hot-loader . With Fast Refresh...
Read more >Troubleshoot incremental refresh and real-time data in Power BI
This can be caused by a data type mismatch where Date/Time is the required data type for the RangeStart and RangeEnd parameters, but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Timer sure! I’m trying to troubleshoot an error I’m getting on worker in my local dev environment:
After some Googling it seems like this is related to React Refresh and I only started seeing this error after upgrading to Next.js 9.4. I should note that there are other people on my team using the same build and not getting this error.
I was just looking for an easy way to turn off Fast Refresh to troubleshoot the issue.
I’d like to know the reason of it too. I’m using TypeScript and exporting types in my components and not sure if that triggers a hard refresh? And how about to work with external libraries which export named components not default exports?