I'm trying to deploy Shopify nodejs app to firebase. The following node_module causes the problem:
"#shopify/shopify-express": "^1.0.0-alpha.7",
and getting the following error:
Detailed stack trace: /user_code/node_modules/#shopify/shopify-express/routes/index.js:19);
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
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)
at Object.<anonymous> (/user_code/node_modules/#shopify/shopify-express/index.js:2:22)
Functions deploy had errors. To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
Is there any chance to deploy with this module? firebase serve is working fine.
Related
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.
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!
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
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.
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!