I just came across this package and tried setting up on my repo. I am using NextJS 14 and edge runtime.
I am deploying the app on cloudflare pages so all routes have to be on edge.
Is there any workaround for this?
// app/login/page.tsx
export const runtime = 'edge';
// firebase.ts
import { initFirebaseRest } from 'firebase-admin-rest';
export const getFirebaseAdmin = async () => {
const db = await initFirebaseRest({
serviceAccount,
databaseId: '(default)',
}).firestore();
return db;
};
CallinggetFirebaseAdmin in a server action results in the following error.
ERROR
[TypeError: Failed to execute 'importKey' on 'SubtleCrypto': 2nd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.] {
code: 'ERR_INVALID_ARG_TYPE'
}
I just came across this package and tried setting up on my repo. I am using NextJS 14 and edge runtime.
I am deploying the app on cloudflare pages so all routes have to be on edge.
Is there any workaround for this?
Calling
getFirebaseAdminin a server action results in the following error.ERROR