Odyssey Lift-Off Part 5: Application Error When Deploying Apollo Client, App Crashing 503

Hey @feedXia ! Thank you for your patience. Coming back to this with fresh eyes over the weekend and I believe I’ve found the issue!

First, to fix the CORS issue was one tiny little thing. In the server app, we need to remove the trailing slash! So it should say:

      origin: ["https://xia-client-catstronauts.herokuapp.com", "https://studio.apollographql.com"]

No slash at the end of the client URL! I have encountered this before and it was definitely frustrating!! With that, it should fix your issues with the client saying “Failed to fetch”.

Second, if your client is still crashing in the logs, you can try this suggestion another user proposed. It requires adding a new config var in Heroku: NODE_OPTIONS set to --max_old_space_size=1024.

Let me know if those work for you and thank you again for your patience!

I also want to note that I removed the cors options in my server and it still worked! So I’m not sure what the original issue was there. You can try the above suggestions, make sure they work, and then afterwards, try removing the cors options from the server as well.

Happy to continue troubleshooting with you and get this sorted!