We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b910fc1 commit fc5c53cCopy full SHA for fc5c53c
packages/react-server/src/ReactFlightReplyServer.js
@@ -131,8 +131,10 @@ ReactPromise.prototype.then = function <T>(
131
let inspectedValue = chunk.value;
132
// Recursively check if the value is itself a ReactPromise and if so if it points
133
// back to itself. This helps catch recursive thenables early error.
134
+ let cycleProtection = 0;
135
while (inspectedValue instanceof ReactPromise) {
- if (inspectedValue === chunk) {
136
+ cycleProtection++;
137
+ if (inspectedValue === chunk || cycleProtection > 1000) {
138
if (typeof reject === 'function') {
139
reject(new Error('Cannot have cyclic thenables.'));
140
}
0 commit comments