How to resolve or troubleshoot firebase deployment issue? - firebase

I am a beginner with Firebase. Facing an issue while deploying functions with Firebase. Could you please suggest how to resolve or troubleshoot the issue
Error: Error occurred while parsing your function triggers.
TypeError: QH.jj is not a function
at /home/circleci/xxx/functions/index.js:1328:601
at /home/circleci/xxx/functions/index.js:6:22
at Object. (/home/circleci/xxx/functions/index.js:10:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at loadModule (/home/circleci/xxx/node_modules/firebase-tools/lib/deploy/functions/runtimes/node/triggerParser.js:10:16)
The code line getting issue:
var QH=require("aws4-axios");require("process");const RH=process.env.ej,SH=process.env.API_PATH,TH=QH.jj
Appreciate your help!

Related

Nextjs next-authjs production issue client_fetch_error invalid json response body at http://127.0.0.1:3000/api/auth/session

I have implemented Nextjs next-authjs with google.
On production i am facing this issue.
umesh.bhat#mcs:/var/mcs/test/gui-mcs-front-end$ npm run dev
> mcs-front-end#1.1.0 dev /var/mcs/test/gui-mcs-front-end
> next
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/index.js:1:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
error - /var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/issuer.js:32
#metadata;
I think the issue is related to NEXTAUTH_URL in env but i am not able to resolve that issue.

TypeError: functions.pubsub.schedule is not a function

Getting this problem deploying a scheduled function on firebase:
Error: Error occurred while parsing your function triggers.
TypeError: functions.pubsub.schedule is not a function
at Object.<anonymous> (/Users/alacret/workspace/kadem-functions/functions/index.js:12:46)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15
at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:53:3)
After searching over the internet for a while I couldn't find an answer, not even reviewing Firebase docs:
https://firebase.google.com/docs/functions/schedule-functions
The problem was with my firebase-functions version, I have it setup to:
firebase-functions:2.2.0
and it needs to be at least 2.3.0 on your package.json

How to update documents from firebase functions? [duplicate]

This question already has answers here:
Firebase functions cannot deploy : SyntaxError: Unexpected token function
(2 answers)
Closed 3 years ago.
I'm triggering a function on a document change and i need to update another one but I'm having an error.
I'm having the same error when try to read one document.
I have deleted every package except firebase-admin, firebase-functions
I have restored my code to only one function.
/user_code/node_modules/firebase-admin/node_modules/gaxios/build/src/index.js:28
async function request(opts) {
^^^^^^^^
SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/user_code/node_modules/firebase-admin/node_modules/gtoken/build/src/index.js:18:18)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
I expect to update the document or to retrieve a document, butI'im having that error. How do I solve this problem?
I believe you're using a older version of Node. Async functions are not supported by Node versions older than version 7.6.
If you want to use async/await then you need to transpile using Babel for your node version.

Firebase Hosting and Angular5 flex-layout

I'm following some instructions from https://github.com/stanleyeosakul/angular-universal-firebase to get my site hosted with firebase. When I run firebase deploy, everything goes fine untill the last step. That's where I get the following error:
Function load error: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: TypeError: _angular_core.OpaqueToken is not a
constructor
at /user_code/node_modules/#angular/flex-layout/bundles/flex-
layout.umd.js:615:19
at value (/user_code/node_modules/#angular/flex-layout/bundles/flex-
layout.umd.js:2:68)
at Object.<anonymous> (/user_code/node_modules/#angular/flex-
layout/bundles/flex-layout.umd.js:5:2)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
Can anyone help me with this error? Is it even possible now to use flex-layout on firebase hosting? I've been trying it allday long and it's just frustrating.
Thanks!

Meteor cannot find path specified

Been trying to start meteor for a day now but no luck. This is what I get when I type meteor at the cmd prompt -
C:\Users\Chris&Vera>meteor
'Vera\AppData\Local\.meteor\' is not recognized as an internal or external
command, operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.
module.js:327
throw err;
^
Error: Cannot find module 'meteor-promise'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at makeCompatible (C:\Users\Chris&Vera\AppData\Local\.meteor\packages\meteor-tool\1.4.4_2\mt-os.windows.x86_32\tools\tool-env\install-promise.js:6:3)
at Object.<anonymous> (C:\Users\Chris&Vera\AppData\Local\.meteor\packages\meteor-tool\1.4.4_2\mt-os.windows.x86_32\tools\tool-env\install-promise.js:9:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
Please help.

Resources