fix: conditional imports

This commit is contained in:
veganbeef
2025-07-17 14:29:24 -07:00
parent 2edd1bd2ae
commit d9c74f163b
4 changed files with 58 additions and 28 deletions

View File

@@ -22,8 +22,9 @@ export default async function RootLayout({
let session = null;
if (shouldUseSession) {
try {
const { getSession } = await import('~/auth');
session = await getSession();
// @ts-ignore - auth module may not exist in all template variants
const authModule = eval('require("~/auth")');
session = await authModule.getSession();
} catch (error) {
console.warn('Failed to get session:', error);
}