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

Long not being pinned is now pulling in ESM version #1241

Closed
Stono opened this issue May 3, 2022 · 4 comments
Closed

Long not being pinned is now pulling in ESM version #1241

Stono opened this issue May 3, 2022 · 4 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Stono
Copy link

Stono commented May 3, 2022

google-gax is used by the @google-cloud libraries (eg https://github.com/googleapis/nodejs-compute/blob/main/package.json#L123).

google-gax seems to reference the library long (eg https://github.com/googleapis/gax-nodejs/blob/main/protos/operations.d.ts#L17), but that dependency is not in the package.json.

long changed to ESM in version 5, which causes our builds to currently fail with:

node_modules/google-gax/build/protos/operations.d.ts(17,23): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

It feels like google-gax (which isn't ESM) should pin long to 4.0.0 in order to ensure compatibility with non-esm apps, until google-gax itself switches to esm.

We've worked around this by:

  "peerDependencies": {
    "@google-cloud/compute": "3.1.2",
    "long": "4.0.0"
  }
@Stono Stono added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 3, 2022
@nolanmar511
Copy link

+1 to this.
@google-cloud/profiler is seeing test failures related to this (I assume users would be similarly impacted). My team has not explored work-arounds yet.

@lovell
Copy link

lovell commented May 3, 2022

I think this might relate to the upstream issue at grpc/grpc-node#2111

@alexander-fenster
Copy link
Contributor

Thank you for the report, I'm looking and will likely ping long to the non-ESM version.

@alexander-fenster
Copy link
Contributor

google-gax v2.30.3 is coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants