Skip to content

Commit 86259b2

Browse files
lubieowocegnoff
authored andcommitted
add comment clarifying the stage behavior in io()
1 parent 7ba34c1 commit 86259b2

File tree

1 file changed

+5
-1
lines changed
  • packages/next/src/server/node-environment-extensions

1 file changed

+5
-1
lines changed

packages/next/src/server/node-environment-extensions/utils.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ export function io(expression: string, type: ApiType) {
104104
)
105105
}
106106
} else {
107+
// We're in the Runtime stage.
108+
// We only error for Sync IO in the Runtime stage if the route has a runtime prefetch config.
109+
// This check is implemented in `stageController.canSyncInterrupt()` --
110+
// if runtime prefetching isn't enabled, then we won't get here.
111+
107112
let accessStatement: string
108113
let additionalInfoLink: string
109-
message = `Route "${workStore.route}" used ${expression} before accessing either uncached data (e.g. \`fetch()\`) or awaiting \`connection()\`.`
110114

111115
switch (type) {
112116
case 'time':

0 commit comments

Comments
 (0)