Cannot create `ChatGoogle` LLM with `GOOGLE_APPLICATION_CREDENTIALS`
Author: wbyoungCreated Sep 17, 2026Updated Sep 17, 2026
Labelsbug
Checked other resources
- This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
- I added a very descriptive title to this issue.
- I searched the LangChain.js documentation with the integrated search.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain.js rather than my code.
- The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
Before running, export GOOGLE_APPLICATION_CREDENTIALS in your shell environment, pointing to a file containing the application credentials. This example is roughly the same as the docs.
import { ChatGoogle } from '@langchain/google'
const model = new ChatGoogle('gemini-3.7-flash', {
platformType: 'gcp',
maxOutputTokens: 2048,
location: 'global',
vertexai: true,
})
const result = await model.invoke([
new SystemMessage(
'You are a helpful assistant that translates English to French. Translate the user sentence.',
),
new HumanMessage('I love programming.'),
])Error Message and Stack Trace (if applicable)
err: {
"type": "AuthError",
"message": "No authentication method available. Please provide either an apiKey or credentials.",
"stack":
AuthError: No authentication method available. Please provide either an apiKey or credentials.
at WebApiClient.fetch (file:///usr/src/app/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_/node_modules/@langchain/google/dist/clients/index.js:207:48)
at file:///usr/src/app/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_/node_modules/@langchain/google/dist/chat_models/base.js:298:47
at pRetry.onFailedAttempt.error.error (file:///usr/src/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@langchain/core/dist/utils/async_caller.js:191:44)
at pRetry (file:///usr/src/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@langchain/core/dist/utils/p-retry/index.js:124:25)
at queue.add.throwOnTimeout (file:///usr/src/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@langchain/core/dist/utils/async_caller.js:191:31)
at run (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/p-queue/dist/index.js:157:104)
at PQueue._tryToStartAnother (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/p-queue/dist/index.js:105:17)
at /usr/src/app/node_modules/.pnpm/[email protected]/node_modules/p-queue/dist/index.js:171:18
at new Promise (<anonymous>)
at PQueue.add (/usr/src/app/node_modules/.pnpm/[email protected]/node_modules/p-queue/dist/index.js:152:16)
"name": "AuthError"
}Description
I'm trying to use this for a new app and not start with the deprecated ChatVertexAI from @langchain/google-vertexai, but I can't seem to get it to work with GOOGLE_APPLICATION_CREDENTIALS.
System Info
/usr/src/app # cat package.json | grep langchain
"@langchain/core": "^1.2.11",
"@langchain/google": "^0.2.6",
"@langchain/google-vertexai": "^2.3.2",
"@langchain/pgvector": "^0.1.0",
"@langchain/textsplitters": "^1.0.1",
/usr/src/app # cat package.json | grep langchain
"@langchain/core": "^1.2.11",
"@langchain/google": "^0.2.6",
"@langchain/google-vertexai": "^2.3.2",
"@langchain/pgvector": "^0.1.0",
"@langchain/textsplitters": "^1.0.1",
/usr/src/app # cat /etc/alpine-release
3.23.3
/usr/src/app # node --version
v24.13.0
/usr/src/app # pnpm --version
10.30.0
/usr/src/app # Source: langchain-ai/langchainjs