-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy Error: Function load error: Code in file index.js can't be loaded #515
Comments
I'm encountering the same issue. My local packages versions are:
|
I'm having the same exact problem, with the same versions of packeges. It seems more like a server failure than code, because minutes ago I was able to upload just fine, but now I get the same error over and over again. |
see Firebase Status Dashboard |
@nobuhito Suggested workaround only works for me when npm cache is cleared before:
But.. it works for now, can deploy my functions again. |
GCF had a backend problem installing firebase-admin@5.4.2. This has been resolved and your functions should work now. Please reopen if you continue to have issues. |
Looks like this issue is back |
@stevejcox which version of firebase-admin are you having this issue with? Can you paste your logs? |
"firebase-admin": "^5.4.1", Debug log at: https://gist.github.com/stevejcox/949e2d960c1dd02b927a7372f8817ac6 It's inconsistent on which functions successfully deploy and which fails. Seems different each time I try to deploy. |
Same here |
+1
Functions have been taking abnormally long to deploy all day, and the issue started happening an hour ago. |
+1 |
+1 package.json
|
Thanks all for the reports. Indeed there's a production issue right now. We're investigating; stay tuned! https://status.firebase.google.com/incident/Functions/17027 |
Same issue with - |
@JoeOsterfeld @benka @faahmad @MchlG Thanks for bearing with us, can you confirm whether or not you're able to deploy your functions now? |
It worked for me, thanks! |
@justinrosenthal I can successfully deploy now, thanks! |
Yes has been working for me too - was only down for about 30-45 min. Sorry
for late reply
…On Thu, Nov 30, 2017 at 7:49 PM, Faraz Ahmad ***@***.***> wrote:
@justinrosenthal <https://github.com/justinrosenthal> I can successfully
deploy now, thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#515 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATugE9VAxCG43zXRh9qFGMDJNciOJiA6ks5s700JgaJpZM4P-mpM>
.
|
Sounds great. Closing the issue. |
I'm getting a similar issue but for 'express' module. Function load error: Code in file index.js can't be loaded. Firebase: I tried doing this: |
I made a simple http request function and I am also facing the same problem:
These are my dependencies:
|
I resolved the issue by adding |
this issue still persist
|
@kamilo81 your |
Ok had this issue. like the error message said, did you missed the dependency you need in I installed So instead of
|
I also have same problem
I remember I have Redis as one of my depedencies, but i don't know how to put it inside my package.json |
@Yosafat1997 you may have to run |
Im getting the same error ( used this tutorial https://hackernoon.com/deploying-angular-universal-v6-with-firebase-c86381ddd445 ) ⚠ functions[ssr(us-central1)]: Deployment error. my versions are Please help, thanks. |
@RahulGuptaIIITA Please run |
@laurenzlong Im following this tutorial and now im seeing Not sure why? Do you know what I could have done wrong? |
Hi, I don't think that's a bug with firebase-tools. Could you please file an issue in the Github repository for the tutorial? https://github.com/aaronte/angular-universal-firebase |
Had this issue with a @types/... module. my package.json
|
I tried install the required module(expo-server-sdk in my case) in the functions folder and it's working now!! |
Are you deploying fuction in proper folder? |
I have the same issue but the problem is with a module I defined myself in my code:
|
ok find the problem. In my specific case it was that I renamed my module from |
I have the same issue I am trying to deploy one of my firebase function it's deploying properly a few mins after I try to deploy the same functions getting this error. Function failed on loading user code. Error message: Code in file index.js can't be loaded. But this looks like different! |
It happened to me as well, then I noticed there is one dependency I thought I installed, Then it worked for me. |
What dependency you installed in the function folder |
same issue
functions/package.json
|
|
I am trying to deploy my functions to firebase, yesterday I was able to do it just fine, but today I just can't get it done. The cli tells me it can't find firebase-admin module, which is listed in the package.json dependencies and is installed. I have done nothing since yesterday to make it stop working, I tried updating firebase-functions to the newest version(0.7.1), but the error persisted.
Version info
Node.js version: 6.11.2
firebase-tools version: 3.13.1
firebase-admin version: 5.4.2
firebase-functions version: 0.5.7
Steps to reproduce
firebase deploy --only functions -P prod
Expected behavior
Functions deployed succesfully.
Actual behavior
Functions get deployed with errors, the cli shows me the following message:
Deploy Error: Function load error: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'firebase-admin'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/user_code/node_modules/firebase-functions/lib/apps.js:25:16)
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)
My package.json (PS: I have firebase here, the client module, because I need to send reset password emails, which are not supported yet by the firebase-admin SDK (firebase/firebase-admin-node#46):
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"version": "0.0.12",
"dependencies": {
"cookie-parser": "^1.4.3",
"cors": "^2.8.4",
"express": "^4.15.4",
"firebase": "^4.5.2",
"firebase-admin": "^5.4.2",
"firebase-functions": "^0.7.1",
"mercadopago": "^0.5.0"
},
"private": true
}
The text was updated successfully, but these errors were encountered: