← All tasks
javascriptgoogleapis/google-cloud-node #5876Not a task: already works

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

envgap__googleapis__google-cloud-node-5876

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
931859eb8578ffc40ef1b2f0046656c5acfede36
Manifest
packages/google-cloud-tasks/package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

googleapis/google-cloud-node #5876 · read the original issue
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"

      }

    }

  },

```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]