diff --git a/src/utils/lazy.ts b/src/utils/lazy.ts index 582aa650c..90e2e7e88 100644 --- a/src/utils/lazy.ts +++ b/src/utils/lazy.ts @@ -20,9 +20,10 @@ export function makeLazy(factory: () => T, attempts = 5, { isIndirect = false const getter = () => { if (!cache && attempts > tries) { + tries++; cache = factory(); - if (!cache && attempts === ++tries && !isIndirect) { - console.error(`Lazy factory failed:\n\n${factory}`); + if (!cache && attempts === tries && !isIndirect) { + console.error(`makeLazy factory failed:\n\n${factory}`); } }