Picture of RunawayHorse .
Unable to parse src/course/en/contentObjects.json
by RunawayHorse . - Tuesday, 5 December 2017, 4:37 PM
 

Hi Guys,

When trying to re-build my course (create my first course exercises) I run into the following warning:

Unable to parse "src/course/en/contentObjects.json" file

I attach a copy of my contentObject.json and the warning itself.

 

What have I done wrong AGAIN please? 😢


Picture of Matt Leathes
Re: Unable to parse src/course/en/contentObjects.json
by Matt Leathes - Tuesday, 5 December 2017, 5:36 PM
 

You're missing a comma on line 72 and you have one where you shouldn't on line 73.

You can use JSONLint to find errors like this - or if you use an IDE like Visual Studio Code it'll automatically detect errors like this for you. It's also got a nice terminal built into the IDE so you don't have to run Terminal separately, you can do it all from inside VSC. You can even debug your content inside it...

Picture of Matt Leathes
Re: Unable to parse src/course/en/contentObjects.json
by Matt Leathes - Tuesday, 5 December 2017, 6:56 PM
 

A feature of VSC I particularly like - if you shut it down with unsaved changes to your files it just closes down without prompting you to save (cue a minor panic!) - but when you open it back up it still has those unsaved changes there, waiting to be saved... *mind blown*

Picture of RunawayHorse .
Re: Unable to parse src/course/en/contentObjects.json
by RunawayHorse . - Wednesday, 6 December 2017, 9:10 AM
 

Hi Matt,

Thank you very much for the advice!

VSC Debugger looks like something extraterrestrial 🛸  right now for me. I think it requires some extensions to be installed before it can do its job with debugging, so I would need to figure out which ones I need out of a list of hundreds of them ... Which ones could you recommend to install please?

I am currently using jsonlint and managed to fix some mistakes - thank you very much!

I got stuck with this one:

It highlights line 564 in components.json file with "string, number, null ..." and there are no commas at the end of the line ... 🤪 ... and I do not remember touching that line at all.

What is the matter there? 🤯

components.json file attached.

 

Thanx a lot in advance!

Picture of Matt Leathes
Re: Unable to parse src/course/en/contentObjects.json
by Matt Leathes - Wednesday, 6 December 2017, 10:54 AM
 

Visual Studio Code makes the problem (line break in the middle of the "final" value) pretty obvious...

You don't need to install any VSC extensions. I would just start using it as-is for now and only start looking into extensions once you've got more comfortable with how it works.

Also, if you do that, it'll have some time to learn about the sorts of things you are doing and will then recommend extensions for you based on what it has learned ;-)