mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
simpler bundleRenderer check
This commit is contained in:
parent
59f8e48549
commit
e2ee016a22
@ -231,18 +231,10 @@ export default class Renderer extends Tapable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderRoute (url, context = {}, ctr = 0) {
|
async renderRoute (url, context = {}) {
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (!this.bundleRenderer || !this.resources.appTemplate) {
|
if (!this.bundleRenderer || !this.resources.appTemplate) {
|
||||||
if (ctr > 5) {
|
return Promise.reject(new Error('bundleRenderer is not available'))
|
||||||
// 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)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log rendered url
|
// Log rendered url
|
||||||
|
Loading…
Reference in New Issue
Block a user