GoogleCloudPlatform / pubsub

This repository contains open-source projects managed by the owners of Google Cloud Pub/Sub.
Apache License 2.0
246 stars 146 forks source link

TypeError: this.auth.getUniverseDomain is not a function #354

Closed birosrichard closed 9 months ago

birosrichard commented 9 months ago

Hi,

When I call pubSub I'm receiving following error. TypeError: this.auth.getUniverseDomain is not a function at GrpcClient.createStub (/workspace/node_modules/google-gax/build/src/grpc.js:312:54)

I'm using "@google-cloud/pubsub": "4.1.1". node 20

const pubSubClient = new PubSub({
    projectId: getConfig().env.stage,
})

export const sendEventToPubSub = async (body: Partial<AnalyticsEvent>): Promise<void> => {
    try {
        const message = prepareMessageForPubSub(body)

        const messageId = await pubSubClient.topic('analyticEvents').publishMessage({
            json: message,
        })
        logInfo('Message published to pubsub, messageId:', messageId)
    } catch (error) {
        logError('Failed to publish message to pubsub, error:', error)
    }
}
kamalaboulhosn commented 9 months ago

Hi, @birosrichard. This repository is specifically for the load test framework and ordering key prober. You should put your issue in the Node Pub/Sub library repo: https://github.com/googleapis/nodejs-pubsub