Skip to content

@google-cloud/secret-manager SecretManagerServiceClient.secretVersionPath throws a type error #5319

@dicearr

Description

@dicearr

Environment details

  • which product (packages/*): @google-cloud/secret-manager@5.5.0
  • OS: Darwin 21.6.0 Darwin Kernel Version 21.6.0
  • Node.js version: v19.6.1
  • npm version: 9.4.0
  • google-cloud-node version:

Steps to reproduce

import { SecretManagerServiceClient } from '@google-cloud/secret-manager';

const secretManager = new SecretManagerServiceClient();

secretManager.secretVersionPath('the-project-id', 'the-secret-name', 'latest'); // Throws

The provided code snippet throws the following error:

/path/to/project/node_modules/@google-cloud/secret-manager/build/src/v1/secret_manager_service_client.js:1161
        return this.pathTemplates.secretVersionPathTemplate.render({
                                                            ^
TypeError: Cannot read properties of undefined (reading 'render')
    at SecretManagerServiceClient.secretVersionPath (/path/to/project/node_modules/@google-cloud/secret-manager/build/src/v1/secret_manager_service_client.js:1161:61)
    ...

Seems to me that this pull-request (5e14553) could've broken the secretVersionPath method, as there is no secretVersionPathTemplate in the pathTemplates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions