TypeError: Cannot read properties of null (reading 'classList')

Hello

When I uploaded an XLS file and previewed the form on kobo toolbox, I get the error message. As a result of this error, my form’s skips are also not working anymore. please help.:

Hello @urmas, welcome to the community :slight_smile:

Can you validate your xlsform in here, and share the result with the community?

All the best,

1 Like

thank you, @hakan_cetinkaya, when I uploaded and previewed the form after validating, I did not receive any error.

But when I open the link in the browser (Chrome in my case), the error continues to pop-up.

Hi @urmas,

Is your form multilingual?

Best,

1 Like

No, all in English

Ok, can you share a screenshot which shows the first row of your survey and choices tabs?

1 Like

Survey

Choices

Hmm, can you share a screenshot of your survey, fully this time?

1 Like

Hello @urmas,
can you check the $given_name column, please. If there is something else then version, you had a duplicate name in your form (survey sheet) before which was automatically changed by KoBo. If the original name was referenced somewhere in your form, this might create the error now (and further hidden erroneous effects in your application).

Different to KoBo, duplicate names are marked by error message if you use the Online validator (ODK - XLSForm Online v2.x) which is always recommended during and at the end of form development, before final upload and deployment. I would also recommend to check if there appears a $given_name column in the downloaded form.

1 Like

Hello @wroos are you saying that on my XLSX file, the $given_name columns should be blank except for where the word ‘version’ is mentioned at the end?

Hello @urmas,
Yes.
The name appearing there was a former duplicate or another invalid name, e.g. with spaces. Both which would have been detected as error by the Online validator.

This original name was replaced/adapted automatically by KoBo (without further notice): creating the new name in the name column of this row. This is done on xls upload already.

The problem is that if the original name was referenced elsewhere in your form these references are NOT updated. They will now reference another question/variable ($given_name), i.e. the first other duplicate or the otherwise invalid original name. Only in the otherwise invalid case (e.g. space in name, no duplicate) you will probably see an error in KoBo too (no such existing variable).

Here an example:
GivenName02.xlsx (9.7 KB)
image

KoBo will internally adapt this to
image

The Online validator will mark the following errors (step-by-step)
image
image

If you have fully fixed the issues, you should delete the $given_name column (and the generated calculate version row at the end). Then you should check again with the Online validator, upload and export the fixed xls and look again for a $given_name column.

@Kal_Lam: It might be preferable to explain this somewhere in the help center documentation. I couldn’t find the token "given_name in the Help center, nor in another documentation (of course not in the XLSForm and ODK specification, as it is KoBoToolbox specific). But there was discussion in the forum, see Search results for 'given_name' - KoBoToolbox Community Forum

The KoBoToolbox behavior might changed in a future release, see Release Notes - versions 2.021.45, 2.021.45a, 2.021.45b - #3 by Josh (@Josh).

1 Like

Hello @wroos , I deleted the $given_name column and checked on the validator (it worked fine). but when I uploaded the xlsx on kobotool again and previewed, I got another error.

Hello @urmas,
there are different constellations where this may happen, for ex. if you have a very long list of questions or of choices. See further hints with the - always recommended - search function of this forum. Search results for 'Unexpected token < in JSON at position 0' - KoBoToolbox Community Forum

1 Like

Thank you for suggesting this @wroos! We will definitely update this post as a new support article.

1 Like