Firebase deploy returns error at tsc command

Rick Slinkman

I've setup a Firebase project to create some basic Firebase Functions.
In the project I'm using TypeScript

Following the Firebase official documentation I created my project.

The last step, firebase deploy --only functions, gave an error with the tsc command.

$ firebase deploy --only functions

=== Deploying to ‘my-project’…

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint /path/to/functions
> tslint --project tsconfig.json

Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build /path/to/functions
> tsc

node_modules/firebase-functions/lib/function-builder.d.ts(60,95): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,96): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,116): error TS1005: ';' expected.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /some/path/.npm/_logs/2019-02-03T00_10_30_573Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code2

Having trouble? Try firebase deploy --help

It seems that some of the Firebase library code does not pass the tsc compile/transpile step. I'm looking for a way to make this deploy step pass.

I've followed the suggestion given at this GitHub issue, which included:

  • Adding --skipLibCheck to the tsc command
  • Adding skipLibCheck to the project's generated functions/tsconfig.json
  • Adding isolateModules to functions/tsconfig.json
  • Adding ./functions/node_modules/@types to the typeRoots array in the functions/tsconfig.json file.
  • Adding dom to compilerOptions.lib in functions/tsconfig.json

None of the above steps have worked for me.

How can I make my deployment to Firebase succeed?

Maigais

Ran into same issue, was able to deploy after upgrading typescript library to 3.3.1 version and do npm install.

In package.json file set "devDependencies": { "tslint": "~5.8.0", "typescript": "~3.3.1" },

Note: you can remove all changes described in your post.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error: hosting:channel:deploy is not a Firebase command

firebase cloud functions command error `firebase deploy --only functions`

Deploy to Node App Azure App Service tsc not recognized as command

Firebase Functions Deploy Error

firebase deploy command for Node.js application results in Error: `runtime` field is required but was not found in firebase.json

Firebase cloud function deploy error

Firebase Deploy Error: Authorization failed

tsc command not compiling to outDir

-bash: tsc: command not found

Parse deploy command error x509

Capistrano error while deploy (command not found: sneakersctl)

Incorrect command error for composer network deploy

Command binding in ContextMenu returns error

Every command returns error in Rhel

Trying to deploy firebase functions Deploy Error: Failed to configure trigger

Why does tsc command emit an error even though vite command works?

After Firebase deploy - Error: cannot find module

ESLint error while trying to deploy firebase functions

ESLint error trying to deploy functions Firebase

Firebase Deploy Error: Failed to configure trigger

Firebase Hosting deploy gives HTTP Error 401

firebase cloud function deploy glob error

Error with Firebase deploy function to send push notifications

Firebase Cloud Function deploy tslint error

node.js firebase deploy error

Firebase deploy error - node_modules missing?

firebase deploy fuctions error Upload Error: HTTP Error: 403

Angular 2 tsc error

Angular Firebase Function Deploy Error: Cannot find module 'firebase/app'