Hiya welcome to Netlify’s support forums! Sorry to hear you are having issues with your code. I’m assuming this is not working on you local machine? Unfortunately, debugging code is outside the realm of support.
We do have these support guides to debug your build, and of course I will leave your thread open so other community members can help.