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

Invalid function when calling could code but hello function is working #1183

Closed
victorpetrovski opened this issue Mar 24, 2016 · 8 comments
Closed

Comments

@victorpetrovski
Copy link

Hello. I am having this issue for over 4 days now and i have no idea how to fix it :( This is my setup
in server.js :
var parseServer = new ParseServer({
databaseURI: "XXXXXXX",
cloud: './cloud/main.js',
appId: "XXXXXX",
masterKey: "XXXXXXX",
serverURL: "https://parsetestapi.appspot.com/parse/"
});

and in app.yaml
CLOUD_PATH: './cloud/main.js'

Please help me i am desperate :D

@firaskafri
Copy link

You shoud use absolute path for your cloud code.

cloud: __dirname + './cloud/main.js' instead of cloud: './cloud/main.js',

@victorpetrovski
Copy link
Author

cloud: __dirname + "/cloud/main.js" so this is now my could path in the server.js file and this is the cloud path that i have in my app.yaml CLOUD_PATH: ./cloud/main.js . But it does not want to deploy my code...

@victorpetrovski
Copy link
Author

also tried CLOUD_PATH: "./cloud/main.js" and cloud: __dirname + "/cloud/main.js" nothing

@victorpetrovski
Copy link
Author

Please someone paste the code from app.yaml and server.js that IS working... I feel desperate :S

@firaskafri
Copy link

not sure why you're using app.yaml
the cloud code main.js has to be inside the same directory that's containing your parse-server.js.

parse-server
..cloud
....main.js
parse-server.js

and then parse-server.js should look like this:

var api = new ParseServer({ databaseURI: 'mongodb://localhost:27017/DATABASE', appId: 'APP_ID', masterKey: 'MASTER_KEY', cloud: __dirname + '/cloud/main.js', serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed push: { android: { senderId: 'SENDER_ID', apiKey: 'GOOGLE_API_KEY' } } });

@victorpetrovski
Copy link
Author

Ok very weird. Now i get " Error Response: [13] Timed out when starting VM's " when i use npm run deploy but now i don't get Invalid function i get bad json. I looked into it and i do have serverURL: "https://parsetestapi.appspot.com/parse/" as i am supposed to...

@firaskafri
Copy link

@victorpetrovski
Copy link
Author

The problem was that i did not have fileKey... i do not use files but i still need this. Thanks a lot!

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

No branches or pull requests

2 participants