File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/next/client/dev/error-overlay Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -173,16 +173,20 @@ function handleErrors(errors) {
173173 }
174174}
175175
176+ let startLatency = undefined
177+
176178function onFastRefresh ( hasUpdates ) {
177179 DevOverlay . onBuildOk ( )
178180 if ( hasUpdates ) {
179181 DevOverlay . onRefresh ( )
180182 }
181183
182- const latency = Date . now ( ) - startLatency
183- console . log ( `[Fast Refresh] done in ${ latency } ms` )
184- if ( self . __NEXT_HMR_LATENCY_CB ) {
185- self . __NEXT_HMR_LATENCY_CB ( latency )
184+ if ( startLatency ) {
185+ const latency = Date . now ( ) - startLatency
186+ console . log ( `[Fast Refresh] done in ${ latency } ms` )
187+ if ( self . __NEXT_HMR_LATENCY_CB ) {
188+ self . __NEXT_HMR_LATENCY_CB ( latency )
189+ }
186190 }
187191}
188192
@@ -192,8 +196,6 @@ function handleAvailableHash(hash) {
192196 mostRecentCompilationHash = hash
193197}
194198
195- let startLatency = undefined
196-
197199// Handle messages from the server.
198200function processMessage ( e ) {
199201 const obj = JSON . parse ( e . data )
You can’t perform that action at this time.
0 commit comments