SyntaxError: Unexpected token < in JSON at position 0

I think there is an issue with Glitch (surprise, surprise…it might just be a temporary issue though). I get a 500 back and the json error as well on a project I know should pass.

It passes when using codesandbox
Edit: I broke it, let me see if I can get a new link
New link: https://g8b7s.sse.codesandbox.io


If you want you can try importing the gomix branch on codesandbox.

  1. You have to remove the engines from package.json

  2. Add the dotenv package, require it in and use it require('dotenv').config()

  3. Add the .env file with MESSAGE_STYLE=uppercase.

  4. Add your code back to myApp.js

You will likely have to restart the server, click the Server Control Panel icon on the left (it is the one that looks like a server rack), and then click the Restart Server button.

I can’t guarantee everything will work because I didn’t test it yet, I just did the .env challenge.

Edit: all the challenges pass for me using codesandbox. If you do want to use it for all the challenges I’d suggest installing nodemon, change the start script to "start": "nodemon server.js" and restart the server one last time manually. Now every time you make a change and save it should auto restart.

1 Like