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