mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
fix(renderer): retry render if renderer is in loading or created state (#5417)
This commit is contained in:
parent
001ba775fa
commit
8b9969599d
@ -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.')
|
||||
|
Loading…
Reference in New Issue
Block a user