Infinite Craft Remake: Code Suddenly Stopped Working

,

I’m developing an improved version of Infinite Craft (just for fun), and everything was going smoothly until suddenly none of the elements work anymore. The whole system is glitching, and even when I revert to older versions, they stop functioning too. Has anyone experienced this or knows how to fix it?

here is my code click view markdown to view (it was too big to post)

I used Groq API for the AI part

If reverting to older versions doesn’t work, then presumably it’s not a change in your code that broke it, but a change in the API, no? That’s always the risk when relying on external services for a core part of your game.

2 Likes

Even if I made a new one?

Are there any error’s in the web-browser’s Web Developer Tools Console?

My Console showed the following two error messages when I tried to combine Earth & Fire.

POST https://api.groq.com/openai/v1/chat/completions 401 (Unauthorized)

AI Error: Error: API Request Failed: 401  - {"error":{"message":"Invalid API Key","type":"invalid_request_error","code":"invalid_api_key"}}
    at Game.fetchCombinationFromAI (primal.html:2572:19)
    at async Game.mergeElements (primal.html:2523:30)

Which clearly indicates that Groq was rejecting the requests from the HTML file, because they were Unauthorized due to an Invalid API Key being provided with the requests.

2 Likes

That’s weird, It worked before, I am using a device (School Chromebook) that restricts inspect and the console

Have you tried asking an HTML/Groq-specific forum? You might get better results than an interactive fiction forum.

1 Like

No, but thanks I will check it out

Not allowing console access is going to make coding and debugging very difficult!