Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading Error: 'TypeError: Cannot set property 'textContent' of null' #2078

Closed
mdestaubin opened this issue Nov 15, 2018 · 5 comments
Closed
Labels
bug Things broken and not working as expected

Comments

@mdestaubin
Copy link
Contributor

mdestaubin commented Nov 15, 2018

Description

The users forms were reportedly working properly until Nov 5th, when some of their forms began showing the loading error: 'TypeError: Cannot set property 'textContent' of null'

Steps to Reproduce

  1. Upload XLSForm from conversation https://app.intercom.io/a/apps/s6hn3a8q/inbox/inbox/2698693/conversations/19407773139 to the HHI server.
  2. Try to open or preview the form.

Expected behavior

The form should open or be previewed properly with no loading errors.

Actual behavior

Loading Error: 'TypeError: Cannot set property 'textContent' of null' pops up.

image

Additional details

@tinok
Copy link
Member

tinok commented Nov 16, 2018

Congrats on your first bug report @mdestaubin 🙌 🕺

@magicznyleszek
Copy link
Member

@jnm do you think this can have something to do with Martijn removing jQuery from Enketo? I remember he mentioned he had bugs because jQuery handles not found nodes behind the scenes.

@jnm
Copy link
Member

jnm commented Nov 28, 2018

@magicznyleszek, maybe. I tried this Multilingual_V_5_03.xls form and a different error appears in Firefox: TypeError: i[0].querySelector(...) is null. Chrome still shows TypeError: Cannot set property 'textContent' of null, though.

In any event, this bug needs to be filed against Enketo Express: https://github.com/enketo/enketo-express/issues

@jnm
Copy link
Member

jnm commented Nov 28, 2018

With the handy-dandy browser developer tools, I was able to figure out that things were getting hung up around this part of the form:

type name
begin_repeat group_csv
calculate ex_date
calculate ex_depatred
calculate ex_staff
calculate ex_order_no
calculate ex_progrmm_loc
calculate all_pujas_date
calculate ex_lang
calculate ex_name
calculate ex_cc
calculate ex_prasad_name
calculate ex_adress
calculate ex_zip_city
calculate ex_country
calculate ex_star
calculate all_pujas_name
calculate all_pujas_date_001
calculate ex_notes
calculate ex_mail
calculate ex_phone
calculate ex_birthdates
end_repeat  

A minimal form to reproduce the problem needs only:

type name label
begin_repeat mysterious_repeat mysterious repeat
end_repeat    

@magicznyleszek, I'll ask you to try your hand at this kind of troubleshooting in the future.

@tinok, is there a valid reason for someone to have a repeating group filled only with calculate questions? If not, can we tell the user that we appreciate the bug report, while advising them that their form design is actually broken? (@mdestaubin, this is what we need to know for you to respond to the user)

@jnm
Copy link
Member

jnm commented Nov 28, 2018

If my understanding of kobotoolbox/enketo-express#1112 is correct, this should be fixed by rejecting forms with empty repeating groups as invalid. I mentioned this particular manifestation of the issue to Martijn at enketo/enketo-validate#38.

@jnm jnm added the bug Things broken and not working as expected label Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things broken and not working as expected
Projects
None yet
Development

No branches or pull requests

5 participants