Smiley Face: Unexpected token '<'

Hi,

I am trying the smiley face tutorial and keep getting this error but I can’t see where I’m going wrong and I’ve checked the code again and again. Can anyone help ? Thanks.

bundle.js:1 Uncaught SyntaxError: Unexpected token ‘<’
DevTools failed to load source map: Could not parse content for https://vizhub.com/assets/service-worker-3ed207ea542911e44861e5df9cf4ad8416231b9acd2dadd63bfce55adc1da683.js.map:

Whoah that’s an odd one! I’m pretty sure there are no service workers in use by VizHub. I’m not sure why this would happen.

One thing to try - open the dev tools and unregister all service workers.

One possibility is that the VizHub Forum (a Discourse instance) has a service worker associated with it, and somehow that is showing up in VizHub app pages.

This is something I’ll need to look into… Thanks for reporting!

But, that sourcemap thing is just a warning. To fix the syntax error, try pressing that colorful “P” icon in index.html to auto-format it.

Thanks Curran, Thank god for that colourful P.

Excellent to hear it worked out!

I’m considering making that colourful P automatic, so it formats the code every time it runs.

Hi Curran,

I am now running into the same issue and now nothing is rendering at all. The autoformat button (colorful P) did auto format my code, but did not resolve the Unexpected token ‘<’ error. I am thinking about restarting from the beginning and copying and pasting your code to figure out where the error first pops up.

I made a lot of changes to the code, and now the error is gone. I am not sure which change cleared the error.

I did change the version of React and ReactDom from 18.2.0 to the 16.9.0 in the video.

I also realized that my visualization has a play button and the visualization in the video does not. It seems like i have to push the play button it update the Vizualization. Not sure why I have a play button and you do not.

Oh interesting… Happy to hear it got solved!

I do want to improve the debugging experience in the upcoming version of VizHub.

It could possibly be that I recoded that video on an older version of VizHub, before it had the play/pause button for toggling auto-run.