mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
fix(nitro): disable automatic spa fallback (#1071)
This commit is contained in:
parent
70f1483f9e
commit
61518a972f
@ -42,10 +42,7 @@ const getSPARenderer = cachedResult(async () => {
|
|||||||
|
|
||||||
function renderToString (ssrContext) {
|
function renderToString (ssrContext) {
|
||||||
const getRenderer = (NUXT_NO_SSR || ssrContext.noSSR) ? getSPARenderer : getSSRRenderer
|
const getRenderer = (NUXT_NO_SSR || ssrContext.noSSR) ? getSPARenderer : getSSRRenderer
|
||||||
return getRenderer().then(renderToString => renderToString(ssrContext)).catch((err) => {
|
return getRenderer().then(renderToString => renderToString(ssrContext))
|
||||||
console.warn('Server Side Rendering Error:', err)
|
|
||||||
return getSPARenderer().then(renderToString => renderToString(ssrContext))
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function renderMiddleware (req, res: ServerResponse) {
|
export async function renderMiddleware (req, res: ServerResponse) {
|
||||||
|
Loading…
Reference in New Issue
Block a user