🏠 back to Observable

Observable

Hello! I am new to Observable and following Shirly Wu tutorials from FrontEndMasters.
I have the following error (pls see the link to notebook), and not quite sure why as my code looks exactly the same as from the tutorials. I have imported the same libraries as well. I would really appreciate some help.

Welcome! Would you mind clicking “Enable link sharing” in the menu on the upper right so that we can see your notebook?

Here’s a notebook that covers how to do this:

Edit @bgchen was more welcoming, but he withdrew his post, so I’ll borrow his words. :wink:

1 Like

Sorry about that. I just made it public.

Hi there,

I filed a suggestion for that notebook: https://observablehq.com/compare/a43840ac1251caac@30...5ca83610bb456ecf@33

What it looks like is that the notebook code is designed to work with a slightly different bit of data - the line d.Genre.split(', ')[0] implies that d.Genre is a string that you’ll split on commas and take the first item from – but the JSON file you have here already has d.Genre as an array, so .split() isn’t defined and hence the error. Pretty much the same thing with the imdbRating field - the code assumes that it’s a string that needs to be parsed into a number, but in the data you’re using, it’s already parsed into a number. Maybe this data is from a later step in the tutorial?

2 Likes