Skip to content

Cloud Tasks 'package.json' has non-working 'exports' for 'protos' #5876

@kalleprymne

Description

@kalleprymne

Issue with: @google-cloud/tasks to v5.5.1

After PR #5696 was merged, it's no longer possible to import 'protos'.
Neither the previously working import:

import { google } from '@google-cloud/tasks/build/protos/protos';

...nor the assumed migrations works:

import { google } from '@google-cloud/tasks/build/protos';

I believe this is due to 'package.json' needs an update in the 'exports' section and that the following lines:

https://github.com/googleapis/google-cloud-node/blob/tasks-v5.5.1/packages/google-cloud-tasks/package.json#L26-L35

...should be updated similar to this (or if wanting to keep old module path "./build/protos/protos" for backwards compatibility?):

  "exports": {
  ...
    "./build/protos": {
      "import": {
        "types": "./build/protos/protos.d.ts",
        "default": "./build/protos/protos.js"
      },
      "require": {
        "types": "./build/protos/protos.d.ts",
        "default": "./build/protos/protos.cjs"
      }
    }
  },

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