File tree 1 file changed +5
-2
lines changed
packages/next/src/client/components/router-reducer
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,14 @@ export async function fetchServerResponse(
69
69
}
70
70
71
71
/**
72
- * Three cases:
72
+ * Four cases:
73
73
* - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully
74
+ * - `prefetchKind` is `temporary` - it means it's a normal navigation, so we want to prefetch the page data fully
74
75
* - `prefetchKind` is `full` - we want to prefetch the whole page so same as above
75
76
* - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully
76
77
*/
78
+ const isNavigation =
79
+ prefetchKind === undefined || prefetchKind === PrefetchKind . TEMPORARY
77
80
if ( prefetchKind === PrefetchKind . AUTO ) {
78
81
headers [ NEXT_ROUTER_PREFETCH_HEADER ] = '1'
79
82
}
@@ -157,7 +160,7 @@ export async function fetchServerResponse(
157
160
// In prod, every page will have the same Webpack runtime.
158
161
// In dev, the Webpack runtime is minimal for each page.
159
162
// We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.
160
- if ( process . env . NODE_ENV !== 'production' ) {
163
+ if ( process . env . NODE_ENV !== 'production' && isNavigation ) {
161
164
await waitForWebpackRuntimeHotUpdate ( )
162
165
}
163
166
You can’t perform that action at this time.
0 commit comments