Skip to content

Commit

Permalink
fix(renderer): retry render if renderer is in loading or created state (
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 30, 2019
1 parent 001ba77 commit 8b99695
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue-renderer/src/renderer.js
Expand Up @@ -452,11 +452,15 @@ export default class VueRenderer {
}
}

async renderRoute(url, context = {}) {
async renderRoute(url, context = {}, _retried) {
/* istanbul ignore if */
if (!this.isReady) {
// Production
if (!this.context.options.dev) {
if (!_retried && ['loading', 'created'].includes(this._state)) {
await this.ready()
return this.renderRoute(url, context, true)
}
switch (this._state) {
case 'created':
throw new Error('Renderer ready() is not called! Please ensure `nuxt.ready()` is called and awaited.')
Expand Down

0 comments on commit 8b99695

Please sign in to comment.