TypeError: D() is undefined #353
-
Im getting this error: I followed the steps in the tutorial. This is my _app.jsx file: import '../styles/Global.css';
import Initialize from '../lib/auth/Initialize';
Initialize()
export default function App({ Component, pageProps }) {
return (
<Component {...pageProps} />
)
} And this is my Initialize function: import * as Auth from 'next-firebase-auth'
export default function Initialize() {
Auth.init({
authPageUrl: "/auth/login",
appPageUrl: "/",
loginAPIEndpoint: "/api/auth/login",
logoutAPIEndpoint: "/api/auth/logout",
firebaseAdminInitConfig: {
credential: {
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
clientEmail: process.env.FIREBASE_CLIENT_EMAIL,
// The private key must not be accesssible on the client side.
privateKey: process.env.FIREBASE_PRIVATE_KEY,
},
databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,
},
firebaseClientInitConfig: {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, // required
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
},
cookies: {
name: 'Lightstar', // required
// Keys are required unless you set `signed` to `false`.
// The keys cannot be accessible on the client side.
keys: [
process.env.COOKIE_SECRET_CURRENT,
process.env.COOKIE_SECRET_PREVIOUS,
],
httpOnly: true,
maxAge: 12 * 60 * 60 * 24 * 1000, // twelve days
overwrite: true,
path: '/',
sameSite: 'strict',
secure: false, // set this to false in local (non-HTTPS) development
signed: true,
},
})
} Could someone help me with this? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
What versions are you using for |
Beta Was this translation helpful? Give feedback.
-
I have fixed this now, I switched to the canary version and it works fine. I have a new problem tho, I'm trying to use session persistance but it wont work: #363 |
Beta Was this translation helpful? Give feedback.
I have fixed this now, I switched to the canary version and it works fine. I have a new problem tho, I'm trying to use session persistance but it wont work: #363