Unit 5 Hackathon Project - uistring/toString error - please help

I have 2 students working on the end of unit 5 hackathon project in AP CSP. They are using the Netflix data columns to create an app that uses movie and tv show data from Netflix, filters the lists, and generates movie and tv show recommendations for the user. However there is a uistring error that I do not know how to fix that is preventing the app from running. Any assistance would be much appreciated. Thank you in advance.

Link to the project or level:

or

What I expect to happen:
An error generates on line 79: setText(“movieTitle”, filteredMovTitles[index]);
The student is trying to display the movie title in her app based on a filter function.

What actually happens:
The following error generates:
WARNING: Line: 79: setText() text parameter value (undefined) is not a uistring.
ERROR: Line: 79: TypeError: Cannot read properties of undefined (reading ‘toString’)

What I’ve tried:
I am not sure how to help this student debug this error. Any suggestions or help would be much appreciated :slight_smile:

Hi, there. I really think that you have two problems. In line 23 you have an extra semicolon. In line 34 you have an extra semicolon and an extra -1.

I remixed the project, changed those lines, and reorganized the rest of the code. Now it is working. Here you have the new link. You will have to import the lists again.

4 Likes

Because of the syntax errors, your typeList is not being traversed. When you want to setText, in line 79, you do not have any string to show. If you use the watchers or a console.log statement, you can track your lists. The typeList has 4593 items, but the other lists are “not available”. They were not populated.

2 Likes

That was so very helpful! My students and I thank you sincerely. Your feedback makes perfect sense. We could not find the errors.

Merry Christmas and Happy Holidays,

2 Likes