-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
googleapis/gax-nodejs
#1242Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I followed the instructions here to initialise my local dev environment to build Firebase Cloud Functions for use with Typescript.
I created this slightly modified example index.ts:
// The Cloud Functions for Firebase SDK to create Cloud Functions and set up triggers.
import * as functions from "firebase-functions";
// The Firebase Admin SDK to access Firestore.
import * as admin from "firebase-admin";
export const helloWorld = functions.https.onRequest(async (request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
// Push the new message into Firestore using the Firebase Admin SDK.
const writeResult = await admin.firestore().collection('messages').add({m: "hi from test function"});
response.send(`Message with ID: ${writeResult.id} added.`);
});As per the instructions I then ran: npm run build
but instead of successful compilation I get:
> build
> tsc
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';
~~~~~~
Found 2 errors in 2 files.
Errors Files
1 node_modules/google-gax/build/protos/iam_service.d.ts:17
1 node_modules/google-gax/build/protos/operations.d.ts:17
Environment details
- OS: Linux
- Node.js version: v16.14.0
- npm version: 8.3.1
google-gaxversion: 2.30.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.