Runtime.UnhandledPromiseRejection - SyntaxError: Unexpected token S in JSON at position 0

Hi, I’m a newbie here. I’ve tried looking at some other posts but I’m still unable to solve the issue here.

My server has been successfully deployed however it shows the following error: “This function has crashed - Runtime.UnhandledPromiseRejection - SyntaxError: Unexpected token S in JSON at position 0”

Here is the screenshot.

Netlify site name: 13inktattooserver
13inktattooserver.netlify.app

I’m willing to provide the link to repo if that helps too.
Thank you.

Doesn’t seem to be a Netlify issue. Whatever JSON you’re trying to parse is invalid. Try checking the JSON before parsing it.

Thanks for looking into this. It’s data fetched from Instagram Basic Display API. Here is a snippet of the code.

Try checking the response body before converting it to JSON. It’s likely not a JSON which is basically what the error says.

Nevermind. I figured it out that it was because I haven’t set up the env on UI yet. After setting it up, the server site is now working as expected.

P/s: I had done the debugging and everything seems good before I noticed the missing env set up.