Skip to content

SecretManagerServiceClient refers to a value, but is being used as a type here? #636

@JustinBeckwith

Description

@JustinBeckwith

I am trying to do something like this:

import { SecretManagerServiceClient } from "@google-cloud/secret-manager";
let client: SecretManagerServiceClient;
client = new SecretManagerServiceClient();

I was really surprised when the client: SecretManagerServiceClient bit didn't work. I get an error like this:

'SecretManagerServiceClient' refers to a value, but is being used as a type here. Did you mean 'typeof SecretManagerServiceClient'?ts(2749)

I'm not 100% sure what we're doing wrong, but I had to dig the whole way into v1 to get what I wanted:

import { SecretManagerServiceClient } from "@google-cloud/secret-manager/build/src/v1";

Metadata

Metadata

Labels

TypeScriptpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions