mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +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 */
|
/* istanbul ignore if */
|
||||||
if (!this.isReady) {
|
if (!this.isReady) {
|
||||||
// Production
|
// Production
|
||||||
if (!this.context.options.dev) {
|
if (!this.context.options.dev) {
|
||||||
|
if (!_retried && ['loading', 'created'].includes(this._state)) {
|
||||||
|
await this.ready()
|
||||||
|
return this.renderRoute(url, context, true)
|
||||||
|
}
|
||||||
switch (this._state) {
|
switch (this._state) {
|
||||||
case 'created':
|
case 'created':
|
||||||
throw new Error('Renderer ready() is not called! Please ensure `nuxt.ready()` is called and awaited.')
|
throw new Error('Renderer ready() is not called! Please ensure `nuxt.ready()` is called and awaited.')
|
||||||
|
Loading…
Reference in New Issue
Block a user