Node v18 throwing credential implementation issue but not with node v16
Describe your environment
- Operating System version: Docker using
FROM node:18.16 - Firebase SDK version: 11.9
- Firebase Product: auth
- Node.js version: 18.16
- NPM version: 9.5.1
Steps to reproduce:
When I upgraded my docker node from 16.19 to 18.16, I get this error:
credential implementation provided to initializeapp() via the "credential" property failed to fetch a valid google oauth2 access token.
However, if I downgrade it back to 16.19, the notifications get pushed out.
From the package.json it says that it can support node 14 and higher but its failing on v18 for me.
Relevant Code:
I'm using very basic:
initializeApp({
credential: applicationDefault(),
})
Operating System Version: node:18.15 Firebase SDK version: 11.9 Firebase Product: auth Node.js version: 18.15 NPM version: 9.6.2
I have the same issue in local development. I've tried all the initialization approaches recommended in Firebase docs.
Error Message:
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: connect ETIMEDOUT 2404:6800:4009:820::200d:443
Code:
var credentials = require("path/to/serviceAccountKey.json");
initializeApp({
credential: cert(credentials),
});
Same issue here
Hey folks, I am unable to reproduce this on v18.15.0 and [email protected]. Do you only experience this issue on linux environments?
Hey folks, I am unable to reproduce this on
v18.15.0and[email protected]. Do you only experience this issue on linux environments?
I haven't tested it on any other environment. I'm using mine on a docker container with node:18.16 image.
Thanks @rossjackson-ma. Could you share a minimal repro or a minimal version of your docker file?
Here is a repo you can clone. I added some README