kalaivanan
kalaivanan
CDCloudflare Developers
Created by kalaivanan on 5/7/2024 in #pages-help
[Error: Failed to retrieve the Cloudflare request context.] { digest: '2404449318'}
How to fix this?
2 replies
CDCloudflare Developers
Created by kalaivanan on 5/7/2024 in #pages-help
How to access to binding variables during nextjs build process?
I'm trying to user D1 with drizzle orm in next js, currently using next auth 5, and using drizzle adapter for that.. How to get the DB instance during build? export const { handlers: { GET, POST }, auth, signIn, signOut, } = NextAuth({ adapter: DrizzleAdapter(getDBInstance()), providers: [ GoogleProvider({ clientId: process.env.GOOGLE_CLIENT_ID ?? "", clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "", }), ], }); This is method to get db instance export const getDBInstance = () => { console.log("getRequestContext", getRequestContext); const DB = getRequestContext().env.AI_FORM_GENERATOR_DB; return drizzle(DB, { schema }); }; How to get access to Binding variable AI_FORM_GENERATOR_DB during build process?
14 replies
CDCloudflare Developers
Created by kalaivanan on 5/7/2024 in #workers-help
How to access to binding variables during nextjs build process?
I'm trying to user D1 with drizzle orm in next js, currently using next auth 5, and using drizzle adapter for that.. How to get the DB instance during build? export const { handlers: { GET, POST }, auth, signIn, signOut, } = NextAuth({ adapter: DrizzleAdapter(getDBInstance()), providers: [ GoogleProvider({ clientId: process.env.GOOGLE_CLIENT_ID ?? "", clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "", }), ], }); This is method to get db instance export const getDBInstance = () => { console.log("getRequestContext", getRequestContext); const DB = getRequestContext().env.AI_FORM_GENERATOR_DB; return drizzle(DB, { schema }); }; How to get access to Binding variable AI_FORM_GENERATOR_DB during build process?
1 replies