Bad Data from Squidex to Algolia


I have a big model which sends custom data to Algolia and in many cases the value stored in Algolia ends up being "Invalid JSON". Is there any way to debug this kind of issue? I have tried reducing the amount of data sent but still seeing Invalid JSON for payloads which should be fine.

Screenshot in Algolia

I guess there is a an encoding problem when a string has an invalid character for JSON. I could add an validation step and we might need a helper method to encode this.

Hmm, the model sometimes has strings that have Norwegian text and some urls do have extra backward slash \ due to legacy API crap. Could those be causing the issue?

Very likely. The \ is a control character.

Ok, when can you deploy the helper method to encode this?

I don’t know yet. Are you running on Cloud or OnPremise?

Hi, I just found out, that it is already solved:

Running it ourselves and the version is

I just asked because of the deployment. But I think the above approach should work.

I tried pulling in the latest Squidex release via Docker but still seeing invalid JSON. Would love to get this resolved due to pressure to wrap up a project.


Have you tested my solution?

No, don’t think so since the latest docker image seems to be 6 days ago. Could you deploy a new version or should I use squidex/squidex/dev-3171?

I have not changed anything, the JSON.stringify is there since a year or so :wink:

Ah, then do you have any feedback on how we can debug the rules resulting in the invalid JSON?

You are right, i have forgotten this. I can probably implement it tomorrow. Today is a horrible day, meetings over meetings.

Cool, will check again tomorrow.

Have a nice day!


I have made a small change to also include the exception message to the error.

Could you create a release tag so we can deploy it? I tried using the build image but that just breaks stuff :confused:

Uncaught ReferenceError: ngDevMode is not defined
    at Module.<anonymous> (app.js?ef8b3c2bdc7d8f9e8b65:2)
    at Module.<anonymous> (app.js?ef8b3c2bdc7d8f9e8b65:2)
    at i (app.js?ef8b3c2bdc7d8f9e8b65:2)
    at Module.<anonymous> (app.js?ef8b3c2bdc7d8f9e8b65:2)
    at i (app.js?ef8b3c2bdc7d8f9e8b65:2)
    at app.js?ef8b3c2bdc7d8f9e8b65:2
    at app.js?ef8b3c2bdc7d8f9e8b65:2

The build tag has the same build process like the release tags, so I have to figure out where this is common from first.

Hi, I have found the problem. This fix should solve it:

Seems to be an angular error:

1 Like