PJQuakJag
PJQuakJag

Reputation: 1247

Firestore Cloud Functions are not deploying after update to Typescript dependency

I am relatively new to Firebase functions and went through the basic "hello world" tutorial to configure Firestore in order to be able to start writing cloud functions.

I have the following code:

import * as functions from 'firebase-functions';

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript

export const helloWorld = functions.https.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});

When I run "firebase deploy" from the project root, it displays the following message:

node_modules/firebase-functions/lib/function-builder.d.ts(60,93): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,94): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,114): error TS1005: ';' expected.
node_modules/gaxios/build/src/index.d.ts(14,66): error TS1005: '>' expected.
node_modules/gaxios/build/src/index.d.ts(14,103): error TS1109: Expression expected.

I did some hunting online and found that this is caused by old versions of typescripts in the dependencies. I updated the dependencies to 3.3.1. Here is my package.json:

"devDependencies": {
    "tslint": "~5.8.0",
    "typescript": "~3.3.1"
  },

However, I still get this error on subsequent deploys. Anyone know how I might be able to troubleshoot?

Upvotes: 3

Views: 910

Answers (1)

PJQuakJag
PJQuakJag

Reputation: 1247

Figured this out! Had to update Firestore with the following:

npm install firebase-admin@latest firebase-functions@latest

And then updated Typescript with following command.

npm install -g typescript

Upvotes: 2

Related Questions