fix(ssr): always return {head,body} from createInertiaApp — .then() fallback for undefined resolve

This commit is contained in:
F4ilji
2026-07-06 18:59:24 +05:00
parent f575325fa7
commit 63b71b87df
+4 -2
View File
@@ -45,6 +45,8 @@ import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
import { Ziggy } from './ziggy';
import { createSsrErrorHandler, logSsrError } from './ssr/errorHandler.js';
const EMPTY_RESPONSE = { head: [], body: '' };
createServer(page =>
createInertiaApp({
page,
@@ -74,8 +76,8 @@ createServer(page =>
.use(plugin)
.use(ZiggyVue, ziggyConfig);
},
}).catch(error => {
}).then(result => result ?? EMPTY_RESPONSE).catch(error => {
logSsrError(error);
return '';
return EMPTY_RESPONSE;
})
);