3

The problem is the same as this question: Firebase Cloud Functions Deploy Error- SyntaxError: Unexpected token '?'

and I've tried all the answers but nothing seems to work.

This is what I get when I try and deploy functions (even the ones that were deploying fine a week ago):

Error: Error occurred while parsing your function triggers.

/Users/islamariful/node_modules/firebase-admin/lib/app/firebase-namespace.js:84
        this.INTERNAL = new FirebaseNamespaceInternals(appStore ?? new lifecycle_1.AppStore());
                                                                 ^

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:1052:16)
    at Module._compile (internal/modules/cjs/loader.js:1100:27)
    at Module._compile (pkg/prelude/bootstrap.js:1394:32)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
    at Module.load (internal/modules/cjs/loader.js:984:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1024:19)
    at Module.require (pkg/prelude/bootstrap.js:1338:31)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/islamariful/node_modules/firebase-admin/lib/default-namespace.js:19:30)

This is my package.json file:

 {
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "16"
  },
  "main": "index.js",
  "dependencies": {
    "axios": "^0.21.1",
    "firebase-admin": "^9.8.0",
    "firebase-functions": "^3.14.1",
    "pdfmake": "^0.2.2"
  },
  "devDependencies": {
    "eslint": "^7.6.0",
    "eslint-config-google": "^0.14.0",
    "eslint-plugin-jsdoc": "^36.0.7",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}

I've tried multiple things but still can't get this to work. Any ideas on how I can fix this?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.