Skip to content

Returning undefined in cloud code throws error #5053

@dplewis

Description

@dplewis

Issue Description

Similar to parse-community/Parse-SDK-JS#417

Steps to reproduce

Parse.Cloud.define('returnUndefined', () => {
  return undefined;
});

Expected Results

return undefined / null
not throw error

Actual Outcome

Unhandled Promise Rejection: Error: The server returned an invalid response.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.0.0
    • Operating System: Mac OSX
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
  • Database

    • MongoDB version: Mongo
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): localhost

Logs/Trace

info: Ran cloud function returnUndefined for user undefined with:
  Input: {}
  Result: undefined functionName= returnUndefined, , user=undefined
verbose: RESPONSE from [POST] /parse/functions/returnVoid: {
  "response": {}
} result=undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions