Skip to content

Error: circular promise resolution chain

Oleg Gulverdashvili edited this page Mar 24, 2019 · 4 revisions

Error: circular promise resolution chain

This usually happens when you have a promise that resolves or rejects with itself.

For example: var p = Promise.delay(100).then(function(){ return p}); .

In this case, the promise resolves with itself which was not intended.

This also happens when implementing live-updating models with a .then method that indicates when the model is "ready". A promise is a process, it starts and it ends.

Promises do not aim to solve such live updating problems directly. One option would be to use an intermediate promise - for example a .loaded property on the model that fulfills with nothing.

resolving it with itself tells it "it is done when it is done"