fix-deploy-and-manifest-issue

This commit is contained in:
Shreyaschorge
2025-07-18 22:55:10 +05:30
parent d9c74f163b
commit bade04b785
8 changed files with 92 additions and 57 deletions

View File

@@ -12,14 +12,12 @@ const WagmiProvider = dynamic(
}
);
export function Providers({
session,
children,
shouldUseSession = false,
}: {
session: any | null;
session: unknown | null;
children: React.ReactNode;
shouldUseSession?: boolean;
}) {
@@ -34,18 +32,31 @@ export function Providers({
return Promise.resolve().then(() => {
// Use eval to avoid build-time module resolution
try {
// @ts-ignore - These modules may not exist in all template variants
const nextAuth = eval('require("next-auth/react")');
const authKit = eval('require("@farcaster/auth-kit")');
return ({ children }: { children: React.ReactNode }) => (
const AuthWrapper = ({
children,
}: {
children: React.ReactNode;
}) => (
<nextAuth.SessionProvider session={session}>
<authKit.AuthKitProvider config={{}}>{children}</authKit.AuthKitProvider>
<authKit.AuthKitProvider config={{}}>
{children}
</authKit.AuthKitProvider>
</nextAuth.SessionProvider>
);
} catch (error) {
AuthWrapper.displayName = 'AuthWrapper';
return AuthWrapper;
} catch (_error) {
// Fallback component when auth modules aren't available
return ({ children }: { children: React.ReactNode }) => <>{children}</>;
const FallbackWrapper = ({
children,
}: {
children: React.ReactNode;
}) => <>{children}</>;
FallbackWrapper.displayName = 'FallbackWrapper';
return FallbackWrapper;
}
});
},