Skip to content
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

unclear error message "Provided code is not a loadable module" #1419

Closed
xxyyzz2050 opened this issue Jun 20, 2019 · 5 comments
Closed

unclear error message "Provided code is not a loadable module" #1419

xxyyzz2050 opened this issue Jun 20, 2019 · 5 comments

Comments

@xxyyzz2050
Copy link

xxyyzz2050 commented Jun 20, 2019

when I deploy my project to firebase using firebase-tools CLI, I got the following unclear error message

functions[hello(us-central1)]: Deployment error.
Function failed on loading user code. Error message: Provided code is not a loadable module.
Could not load the function, shutting down.

what does this error message mean, and how to fix it?

function
functions/index.js

export const hello= functions.https.onRequest((request, response) => {
  response.send('firebase function works');
});

repo: https://github.com/xxyyzz2050/eldeebCMS
script: npm run start:firebase = npm run build:firebase + npm run serve:firebase

note
firebase serve works fine

edit
I fixed the issue, but please provide us clear error messages

@samtstern
Copy link
Contributor

@xxyyzz2050 can you explain what you did to fix this issue?

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label Jun 20, 2019
@abeisgoat
Copy link
Contributor

Doing a bit of Googling, I can't find any reference to this error anywhere on the internet, which means it's probably from an internal Google service. That's definitely outside my area, but I get the feeling this isn't something easily fixed. If the code isn't a module, we can't really tell you why, we just know it isn't.

@samtstern
Copy link
Contributor

I am pretty sure this error comes from here:
https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/2dcb838175c228da2b8ae8f652708a717c6e2f12/src/invoker.ts#L155

But AFAIK the framework is only use in Node 10+ which is why I asked about the node version.

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Jun 22, 2019
@abeisgoat
Copy link
Contributor

So this isn't an issue for firebase-tools really because if anything, it's a functions-framework bug. Regardless, @xxyyzz2050 says it was user error and since they haven't responded to explain what they did to fix it, i can't really help to improve the error because a module could be invalid for many specific reasons. So I'm gonna close this, but feel free to reopen @xxyyzz2050 if you feel like providing more info.

@ashwingattani
Copy link

@xxyyzz2050 can you elaborate on how you fixed the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants