mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25: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 */
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user