Skip to content

Commit 7dba6db

Browse files
committed
Ignore async stack frames when determining whether we have unfiltered frames on a Promise
1 parent c80e3d8 commit 7dba6db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,15 @@ function hasUnfilteredFrame(request: Request, stack: ReactStackTrace): boolean {
259259
const url = devirtualizeURL(callsite[1]);
260260
const lineNumber = callsite[2];
261261
const columnNumber = callsite[3];
262-
if (filterStackFrame(url, functionName, lineNumber, columnNumber)) {
262+
// Ignore async stack frames because they're not "real". We'd expect to have at least
263+
// one non-async frame if we're actually executing inside a first party function.
264+
// Otherwise we might just be in the resume of a third party function that resumed
265+
// inside a first party stack.
266+
const isAsync = callsite[6];
267+
if (
268+
!isAsync &&
269+
filterStackFrame(url, functionName, lineNumber, columnNumber)
270+
) {
263271
return true;
264272
}
265273
}

0 commit comments

Comments
 (0)