Error "Invalid module output" for a custom app

Hey Makers,
I’m trying to build an app for our remberg API to allow file uploads. Unfortunatley I’m stuck with the error message, after the API request got processed successfully. (file got uploaded to our solution)

{
    "type": "error",
    "array": "Invalid module output. Expected Object, but found Array.",
    "_engineData": {
        "calledAt": "Not available"
    }
}

The response I’m getting looks like:

[
    "Invalid module output",
    [
        {
            "_id": "xxxxx",
            "createdAt": "2023-02-10T10:59:37.687Z",
            "updatedAt": "2023-02-10T10:59:37.687Z",
            "originalName": "remberg docs.png",
            "name": "remberg docs (2).png",
            "ancestors": [],
            "fileType": "image/png",
            "description": "",
            "isFolder": false,
            "isPublic": false,
            "size": 11316
        }
    ]
]


I cannot find any practical advice in the documentation and I’m running out of ideas what to do.

Hey!
It seems that you have the wrong output format.
If you selected the Action module type, then the output should be an object.
In case of a Seacrh module, it should be an array.
So in your case, I suggest you have Action module, but your API is returning an array.
Try to wrap the output into an object, and it should fix the issue.

//You probably have this: 
"response": {
        "output": "{{body}}"
    }
//Try this instead. I added the result key 
"response": {
        "output": {
               "result":"{{body}}"
                  }
    }
}```
8 Likes

Thank you for your help, now it works like a charm. :relaxed:

Hi, @stepan and @digitalyours

I have (almost) the same error: “Invalid item in module output. Expected Object, but found String”.

I think my solution might be the same thing @stepan said, but…

My question is: Where do you guys go to edit code in Make?

You have to put it under Communication, I’ve provided a screenshot for your convenience.

1 Like

Hey, thanks a lot for your prompt response.

Now I see this screen is inside the app construction… and my problem was happening using third-party apps, not one of my own.

Long story short, yesterday I decided to simply start my scenario over… and it worked!

Thanks a lot for your patience and promptness, @digitalyours !