Next.js Discord

Discord Forum

Clear browser console after hot reload

Unanswered
Raspberry Horntail posted this in #help-forum
Open in Discord
Raspberry HorntailOP
Is there any way to clear browser console like in Vite
(this code clears console in react vite after hot reload)
if (import.meta.hot) { 
 import.meta.hot.on( 
  "vite:beforeUpdate", 
  () => console.clear() 
 ); 
}

Is there similar thing in next js dev mode? similar to this

2 Replies

Raspberry HorntailOP
full vite example
nope afaik this is not possible in nextjs