From e2ee016a22bf915b04a38032382ca6d15a6d52a6 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 14 Jun 2017 22:12:20 +0430 Subject: [PATCH] simpler bundleRenderer check --- lib/renderer.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/renderer.js b/lib/renderer.js index ba93de2195..f73604ce86 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -231,18 +231,10 @@ export default class Renderer extends Tapable { } } - async renderRoute (url, context = {}, ctr = 0) { + async renderRoute (url, context = {}) { /* istanbul ignore if */ if (!this.bundleRenderer || !this.resources.appTemplate) { - if (ctr > 5) { - // Don't wait more than 5 seconds - return Promise.reject(new Error('bundleRenderer is not ready')) - } - return new Promise((resolve) => { - setTimeout(() => { - resolve(this.renderRoute(url, context, ctr++)) - }, 1000) - }) + return Promise.reject(new Error('bundleRenderer is not available')) } // Log rendered url