mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
Fix auth page build: use dynamic import to avoid Firebase at build time
Next.js evaluates page modules during build even with force-dynamic. Using next/dynamic with ssr:false prevents Firebase module evaluation during the build step, which fails because firebase-admin requires actual credentials not available at build time.
This commit is contained in:
@@ -1,21 +1,9 @@
|
||||
'use client'
|
||||
import dynamic from 'next/dynamic'
|
||||
|
||||
import React from 'react'
|
||||
import AuthWizard from '@/components/Wizard/AuthWizard'
|
||||
import { FormWizardProvider } from '@/context/formWizardProvider'
|
||||
import { AuthStep } from '@/Models/Wizard'
|
||||
import { SwapDataProvider } from '@/context/swap'
|
||||
export const revalidate = 0
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
const AuthContent = dynamic(() => import('@/components/AuthContent'), { ssr: false })
|
||||
|
||||
const AuthPage = () => {
|
||||
return (
|
||||
<SwapDataProvider>
|
||||
<FormWizardProvider initialStep={AuthStep.Email} initialLoading={false}>
|
||||
<AuthWizard />
|
||||
</FormWizardProvider>
|
||||
</SwapDataProvider>
|
||||
)
|
||||
export default function AuthPage() {
|
||||
return <AuthContent />
|
||||
}
|
||||
|
||||
export default AuthPage
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
'use client'
|
||||
|
||||
import React from 'react'
|
||||
import AuthWizard from '@/components/Wizard/AuthWizard'
|
||||
import { FormWizardProvider } from '@/context/formWizardProvider'
|
||||
import { AuthStep } from '@/Models/Wizard'
|
||||
import { SwapDataProvider } from '@/context/swap'
|
||||
|
||||
export default function AuthContent() {
|
||||
return (
|
||||
<SwapDataProvider>
|
||||
<FormWizardProvider initialStep={AuthStep.Email} initialLoading={false}>
|
||||
<AuthWizard />
|
||||
</FormWizardProvider>
|
||||
</SwapDataProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user