Error while executing App server script! - Unexpected end of input

Hi Team,

I am facing some issues with the marketplace app. The error message and screenshot has been provided below. Please take this as priority as we have some demo tomorrow.

ERROR MESSAGE:

  1. errorSource: “APP”
  2. message: “Error while executing App server script! - Unexpected end of input”
  3. requestID: “d5f5cc61-f382-4e50-95d2-ec618ff115c8”
  4. status: 500

Thanks,
Aravind Jinapaneni

2 Likes

Hi @Aravind_Jinapaneni,
Welcome to the Developer Community :tada:

This is an issue in app Install callback. Did you call renderData() as the last statement in your callback handler?

2 Likes

Hi @ManiDeepak_Vandrangi,

yes I have given. The code is running properly when I try it in my local. This issue is happening only when I deploy the app in Freshsales.

Can you once try to remove any comments after closing } in the file server.js? This error looks like more of app issue so, can you please share the snippet of app install handler here.

1 Like

I haven’y made any comments. Below is the code snippet

        var responseJson = {};
        try {
            var dealId = options.dealId;
            var response = await axios.create({
                baseURL: options.iparams.freshsales_url,
                headers: { "Authorization": "Token token=" + options.iparams.freshsales_api_key, 'Content-Type': 'application/json' }
            }).get("api/deals/" + dealId + "?include=deal_stage");
            responseJson = { "dealData": response.data };
        } catch (err) {
            console.error("Error in getDealStage ", err);
        } finally {
            renderData(null, responseJson);
        }
    },

May I know why are you sending response in renderData while you are installing the app? I believe this is the snippet present under onAppInstall Handler function.