googleapis / googleapis/google-api-nodejs-client
typescript compilation issue with proto-loader: 0.6.11
- Vorherrschende Sprache
- TypeScript
- Sterne
- 12.2k
- Forks
- 2k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
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
1. npm i
2. 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.
Thanks!
[repro.tar.gz](https://github.com/googleapis/google-api-nodejs-client/files/8614617/repro.tar.gz)
Beitragsleitfaden
Rechercherichtung
Beginne mit dem angehängten Repro-Projekt, führe npm i und npx tsc aus und untersuche, wie @grpc/proto-loader 0.6.11 zusammen mit googleapis und den in den Fehlern genannten generierten .d.ts-Dateien aufgelöst wird. Vergleiche das Ergebnis mit 0.6.9; das Issue ist erledigt, wenn die gemeldeten TypeScript-Kompilierungsfehler unter dem dokumentierten Reproduktions-Setup nicht mehr auftreten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- grpc, nodejs, typescript
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100