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 61c95d0 commit bd4289bCopy full SHA for bd4289b
packages/react-server/src/ReactFlightReplyServer.js
@@ -135,8 +135,10 @@ ReactPromise.prototype.then = function <T>(
135
let inspectedValue = chunk.value;
136
// Recursively check if the value is itself a ReactPromise and if so if it points
137
// back to itself. This helps catch recursive thenables early error.
138
+ let cycleProtection = 0;
139
while (inspectedValue instanceof ReactPromise) {
- if (inspectedValue === chunk) {
140
+ cycleProtection++;
141
+ if (inspectedValue === chunk || cycleProtection > 1000) {
142
if (typeof reject === 'function') {
143
reject(new Error('Cannot have cyclic thenables.'));
144
}
0 commit comments