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.

Property 'PublisherClient' does not exist on type #610

@gaohannk

Description

@gaohannk

I am following the sample code here. https://github.com/googleapis/nodejs-pubsub/blob/master/samples/topics.js

const {v1} = require('@google-cloud/pubsub');

// Creates a publisher client
const client = new v1.PublisherClient({
// optional auth parameters
});

When I migrate to typescript, I got this error:

src/pubsubclient.ts:7:23 - error TS2339: Property 'PublisherClient' does not exist on type 'typeof import("/Users/hangao/Zume/ingest/node_modules/@google-cloud/pubsub/build/src/index")'.

7 const pubsub = new v1.PublisherClient(credential);
~~~~~~~~~~~~~~~

Environment details

  • OS: mac
  • Node.js version: v8.9.4
  • npm version: 6.9.0
  • @google-cloud/pubsub version: "@google-cloud/pubsub": "^0.28.1",

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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