Why does the Catstronaut indicate "Error! Unexpected token < in JSON at position 0"?

Hi, there!
Now, I’m trying Apollo Odyssey and have one question for it.

At 1:43 of this video in ODYSSEY, the screen shows the json response.

However, my screen shows the following message, “Error! Unexpected token < in JSON at position 0”, instead of the json response.

You can see the string of “undefined” when I debug in the client/src/pages/tracks.js.

Why does the Catstronau in my localhost indicate “Error! Unexpected token < in JSON at position 0”, although I do programming following the video and the document of ODYSSEY - LIFT-OFF I: BASICS.

I would like you to tell me how to solve this error.

Thank you.

Currently, I’ve yet to get any answer or tips.
So I posted the same question in the StackOverflow as well. If any, I will share the answer.

Thank you.

Hello there,
I think the error comes from the fact that your ApolloClient configuration targets to the wrong port
in odyssey-lift-off-part1/index.js at 560c7fbf0fb228722d7a26fb6f1aae145a3c2a75 · echizenyayota/odyssey-lift-off-part1 · GitHub

it’s currently pointing to http://localhost:3000 when the server is running on http://localhost:4000

Hope this helps!

1 Like

Hi, Raph!
I am afraid that I am too late to share my message.

As you mentioned and I fixed the wrong port, 3000 to correct port, 4000, my screen indicated the JSON data.

At the same time, I launched not just the http://localhost:3000 but also http://localhost:3000. Actually, I could not come up with that I need to launch two local hosts when I posted this question.

Anyway, I’ll continue this tutorial.

Thank you so much!