Unexpected token < in JSON at position 0

I am trying to deploy an XLS form and open it for testing and data collection but I keep getting the error “Unexpected token < in JSON at position 0”. Peculiarly, I deployed this form, without error, then changed a label name and now I only see this error. I have deployed the form many times to no avail and have checked for critical errors and there are none.

I have tried to use the “ODK - XLSForm Online v2.x” to test the form and the only critical error that appears is the use of “begin_kobomatrix” which has always worked in the past for me, regardless of this error, and has supporting documentation for use in XLS forms.

This error seems to go away, after some time, but it does so arbitrarily. I would appreciate any insight into why my form can’t be opened and why it seems to work and not work arbitrarily. Additionally, when I try to open the survey on Safari as opposed to Chrome I get a “String does not match the expected pattern” instead of the aforementioned “Unexpected token” error.

Hi @mar
Welcome to the community forum. Do you experience the same problem when you revert back to the original unedited label name? Can you indicate what label name you had previously and currently?

Stephane

1 Like

Hi @stephanealoo ,
Thank you for getting back so quickly!
Yes, I have tried to and it still seems to bring up the error.
I can’t put the exact text but it was something like this:

(1) Text text text
(2) Text text text
(3) Text text text
(4) Text text text
(5) Text text text

Which was changed to:
(1) Text text text
(2) Text text text
(3) Text text text
(4) Text text text (5) Text text text

Because an extra line break was appearing between item 4 and 5.

@mar seems like you have used the begin_kobomatrix to design your xlsform. Could you kindly confirm?

Hi @Kal_Lam ,
Yes, that is correct. I used begin_kobomatrix to design the form.

Well, in this case, please be informed that begin_kobomatrix is a method that only works with KoBoToolbox and should not work with other software that supports xlsform. Hence, for this reason, you are receiving an error message with the online validator.

@Kal_Lam :
Ah okay, that makes sense. Thank you! Additionally, and this is quite strange, but after leaving the survey overnight and trying it this morning, the ‘Unexpected Token’ message does not appear on Kobo anymore and the survey could be opened.

1 Like

tengo este problema en todos mis formularios implementados, es un error que ha sido recurrente todo esta semana

Hi @monitoreoprevencionh
Could you please confirm if you are still seeing this error?

Stephane

1 Like

hola. no ya no, pero me ha pasado como 4 veces en esta semana, porque sucede?

Este debe haber sido un problema en nuestros sistemas que desde entonces se ha resuelto. Por favor, manténganos informados si esto vuelve a surgir.

1 Like

Hello.
I’ve been having the same problem.

image

It happens when I deploy my form for the first time and I try to preview.
When I try to preview in a second or third time, it works.

I ask myselft if this problem can affect the data my team get?
Thanks your for your answer.

@angelajim, are you still seeing this issue? If yes, would you mind validating your xlsform through this online validator to see if there are any syntax issues?

Hello. Yes, the issue still happend each time I deploy my survey. But when I preview the form twice or three times and I can visualize it.
I tried online validator but apparently everything it’s ok. Anyway, my survey works and I’ve already been working on field. Thank you for your answer.

@angelajim, how long is your survey project (i.e. how many questions does your survey project have)?

Hello. It’s 237 questions.

Which is the browser you are using? Try using some modern browsers like Chrome, Edge, Firefox etc.

Hello. I use Google Chrome. But this week the problem stop happening. So everything it’s ok right now. Again, thank you for your support.

1 Like

Thank you for confirming @angelajim!

Estimado @Kal_Lam

Desde ayer 3 de agosto a mi me aparece ese mensaje en algunos de los formularios, los implementé satisfactoriamente y los abrí sin ningún problema después en la tarde ya no se podían abrir me mandaba el mensaje Token… así que pensé que algo había hecho mal así que los eliminé y los volví a implementar, y ahora solo puedo abrirlos desde formularios web Enketo en la pc y la app para el teléfono móvil, pero no puedo abrir desde Enketo en los teléfonos móviles ya que me sigue apareciendo el mismo mensaje: Token…

Gracias por la lectura