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

typescript error with @grpc/proto-loader: 0.6.11 #2113

Closed
belivo opened this issue May 3, 2022 · 1 comment · Fixed by #2114
Closed

typescript error with @grpc/proto-loader: 0.6.11 #2113

belivo opened this issue May 3, 2022 · 1 comment · Fixed by #2114

Comments

@belivo
Copy link

belivo commented May 3, 2022

Hi, I'm getting typescript compilation with new version of @grpc/proto-loader: 0.6.11

I have a depencency on 'googleapis'. Previous version resolved was @grpc/proto-loader: 0.6.9 not causing issue. Now it's resolving to 0.6.11 with the following typescript compilation error:

node_modules/@google-cloud/pubsub/build/protos/protos.d.ts:15:23 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

15 import * as Long from "long";


node_modules/google-gax/build/protos/iam_service.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.

17 import * as Long from 'long';

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.

17 import * as Long from 'long';

Environment details

OS: centos8
Node.js version: 14.16.0
npm version: 6.14.11
googleapis version: 100.0.0 (same issue in v95)

Steps to reproduce

npm i
npx tsc

Strangely the resolved version on my ubuntu machine is still 0.6.9, but on my centos machine, it resolves to 0.6.11. In the attached repro project, I have explicitely added "@grpc/proto-loader": "0.6.11" to trigger the issue.

Note that I've entered the same issue in @googleapis because I'm not sure where the issue come from.

Thanks!

repro.tar.gz

@mi-kei-la
Copy link

I am having this same problem, and found they are already working on it. You can see the issue here:
googleapis/gax-nodejs#1246

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.

2 participants