Skip to content

Commit 5dfd866

Browse files
authored
Treat _debugInfo as a wellknown property for sync request data access purposes (vercel#78942)
When we converted our request access APIs to async we supported sync access to make the adoption easier. We do have a list of certain builtin properties that exist on promises or are tested for in the course of runtime operations that we say are not synchronously accessible however and you must await the request data promise to access those if necessary. Recently it was discoverd that React will check the `_debugInfo` property of thenables and other async data types in dev. This was being reported as a warning when passing searchParams from RSC to client world. By adding `_debugInfo` to the wellKnownProperties set we can avoid this warning by also making it so you must await the promise to access a true request value such as `?_debugInfo=...` in a search string. This change adds this property name to the well known set
1 parent 7049b93 commit 5dfd866

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/next/src/shared/lib/utils/reflect-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const wellKnownProperties = new Set([
4040

4141
// React introspection
4242
'displayName',
43+
'_debugInfo',
4344

4445
// Common tested properties
4546
// fallthrough

0 commit comments

Comments
 (0)