Troubleshooting tips within codecademy editor/javascript in general

Does anyone have any good tips for troubleshooting code that is ran in the inline editor? I have tried to console log things out throughout this whole course but I can never seem to get any results or make it work when my code is not currently working. I was able to do this through the JavaScript course fairly easy, but React is not playing nicely with it.

Most of CA’s builtin error alerts are fairly unhelpful when trying to track down an issue. Like this:

Oops! The test returned an error. Maybe you have a syntax error, or a typo. Hide error.

/home/ccuser/node_modules/chai/lib/chai/assertion.js:141
throw new AssertionError(msg, {
^
AssertionError: Try checking your code again. You likely have a syntax error.: expected true to equal false

I have no idea where to look for the issue. Am I missing something? I am using Chrome dev tools and have React dev tools plugin installed (that says that react is not being used on this website) so thats worthless.

I don’t know if it just the builtin editors fault or if its Javascript in general but its been very hard to troubleshoot compared to Python. It frustrating, and troubleshooting is one of my favorite things about programming, this is not going well for me :\

Its even more difficult on objectives without any error checking. I just spent an hour comparing my work with others trying to figure out why my “thoughts” wouldn’t disappear.

Turns out I was missing a comma between React, and { useEffect } in my import line.

There has to be a better way! I thought maybe downloading all the files to use in a separate editor/debugger but I do not see a way to download ALL of the project files

What line was this error on?

It was line 1 of the file

I can’t tell you what’s going on without looking at your code. Feel free to share.
In my experience, it’s common to get some “errors” from the learning environment when you don’t meet the somewhat precise criteria of their tests. Make sure your code is doing exactly what the lesson prompt asked you to and it might help.



I hope these help.

While these are good resources, they do not really help with debugging and troubleshooting React/Javascript code in the Codecademy online editor/Environment. They all work fine when working on my local machine and while running React locally, which also works real nice with the React Developer Tools extension for Chrome. Unfortunately React dev tools do not even recognize that React is running while doing work in the Codecademy Environment/Editor.

Chrome’s own dev tools do not seem to work well either while in this envrionment, or at least it doesn’t work the same as when I run it with code on my local machine. Im wondering what others have done while going through these lessons, to better troubleshoot code within the Codecademy environment.

Then, debug where you know it will properly recognize your errors, then paste back into the Codecademy editor.

For example, sometimes I have an error that I can’t find in Codecademy, so I post it in Visual Studio Code, run a debug, fix my error, then paste back into the editor.

So do you run create-react-app and download all the required files from the work environment, each time you want to troubleshoot? Do you find any issues with not knowing which version they are running their examples on?

Im on the Video Player project and they haven’t even mentioned starting up a React environment locally. I only know how from other learning materials but was hoping to learn more about doing this with codecademy.

I’m not really sure. I don’t even use JS that much. Sorry I couldn’t help more.

1 Like