problems (abort() and stop application)


I build my Html game into the site and use I’m trying to return the data in defold (Json as a string), but the string does not return all and with strange characters at the end.

At the top of the line, which should return, from below, as it takes a defold. I made this line much longer - the result is the same - a few last characters are replaced

lua code"callApi('".. self.method.."', { "..self.params_str_html5.." }, "..self.key..");")

    local timer_id = nil
    timer_id = timer.delay(0.1, true, function()
      local response ="vkCallback("..self.key..")")

      if response ~= '' then
        local jd = json.decode(response)

js code

			var api_responses = [];
			function callApi(method, params, key) {
				VK.api(method, params, function (data) {
					api_responses[key] = JSON.stringify(data);
			function vkCallback(key) {
				var response = '';
				if (api_responses[key]) {
					response = api_responses[key];
					delete api_responses[key];
				return response;

If I try to get a string directly, I get an error and the app is stopped

-- lua
local test_resp ='getStartParameters()')

-- js
function getStartParameters() {
     return '[{"id":35917273,"first_name":"Любовь","last_name":"Чижевская","sex":1,"photo_50":"","photo_100":""},{"id":59262819,"first_name":"Витя","last_name":"Гиль","sex":2,"photo_50":"","photo_100":""}]';

I will be grateful for your advice on solving this problem!

Thank you!


@Mathias_Westerdahl what’s the max length of a response for

You mentioned an error as well. What kind of error?


You can make a small native extension to return the data you need from the JS. I think it still has limitations but may not be as small?


Thanks for answers!
Up to 250 characters no error occurs. Now I break the response into 250 characters and glue together before decoding. The problem has disappeared - now everything works well!

There was a message that something like “created crushdump” in data/.defold, I will be glad to give more information if you tell me how I can get it. Thank you!


I’m glad you could work around it.

There’s definitely something weird going on though, and we’ll look into this further.