Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kalleprymne opened this issue Dec 11, 2024 · 0 comments · Fixed by #5878
Closed

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

kalleprymne opened this issue Dec 11, 2024 · 0 comments · Fixed by #5878

Comments

@kalleprymne
Copy link

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"
      }
    }
  },
@kalleprymne kalleprymne changed the title Google Tasks 'package.json' has non-working 'exports' for 'protos' Cloud Tasks 'package.json' has non-working 'exports' for 'protos' Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant