Error : 'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: .".' #2629
Operating System version: Linux using from Chrome os
Firebase SDK version: firebase-admin : 12..2.0
Firebase Product: auth
Node.js version: V20.14.0
NPM version: 10.7.0
[REQUIRED] Step 3: Describe the problem
Facing this error:
'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: .".'
I set env also when I check it from console.log I got service account file values as object but still face this error when it hit that post request I got this error
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Facing this error: 'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: .".' I set env also when I check it from console.log I got service account file values as object but still face this error when it hit that post request I got this error
Relevant Code:
that's my code: const admin =require ('firebase-admin') const { getAuth } = require('firebase-admin/auth'); try { admin.initializeApp()
} catch (error) { console.log(error) }
app.post('/api/auth/signup',async(req,res)=>{ try { const {email,password,username} = req.body; const user = await getAuth().createUser({ email, password, }) } catch(error){ console.log(error } }