Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

using "topic.exists()" raises "TypeError: Channel's second argument must be a ChannelCredentials" #31

@MohsenElgendy

Description

@MohsenElgendy

Environment details

  • OS: Ubuntu 16.04
  • Node.js version: 9.3.0
  • npm version: 5.5.1
  • @google-cloud/pubsub version: 0.16.1

Steps to reproduce

  1. Setup PubSub emulator and set PUBSUB_EMULATOR_HOST
  2. run topic.exists()

This issue does not happen with PubSub version 0.15.0, when upgrading to 0.16.* and calling topic.exists() the following error occur:

[0] (node:48) UnhandledPromiseRejectionWarning: TypeError: Channel's second argument must be a ChannelCredentials
[0]     at ServiceClient.Client (/usr/src/app/node_modules/google-gax/node_modules/grpc/src/client.js:472:19)
[0]     at new ServiceClient (/usr/src/app/node_modules/google-gax/node_modules/grpc/src/client.js:884:12)
[0]     at /usr/src/app/node_modules/google-gax/lib/grpc.js:245:12
[0]     at <anonymous>
[0]     at process._tickCallback (internal/process/next_tick.js:160:7)
[0]     at Function.Module.runMain (module.js:703:11)
[0]     at startup (bootstrap_node.js:194:16)
[0]     at bootstrap_node.js:618:3
[0] (node:48) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[0] (node:48) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks!

Metadata

Metadata

Labels

🚨This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions