API returning error and also CORS error

I am trying to use this API, which I found on the website https://random-word-api.herokuapp.com/. The objective is to return a random word for my wordle game. The problem is that it is not returning the grid anymore, when I try to click in any of the options it returns some errors on the console, as shown in the image below. I spotted that the undefined error happens probably because there is no word to generate the grids. I found it weird that it is returning a CORS error, for being backend stuff, and tried to look into the API's website and entering in the https://random-word-api.herokuapp.com/word to see what happens, and it is returning a java error
No description
15 Replies
Pi, a future fluent jp speaker
java.lang.NoClassDefFoundError: Could not initialize class play.api.libs.json.Writes$
at Main$.getWord(Main.scala:129)
at Main$.$anonfun$new$18(Main.scala:99)
at cask.router.Result$Success.map(Result.scala:21)
at cask.router.Result$Success.map(Result.scala:20)
at Main$.$anonfun$new$10(Main.scala:99)
at cask.router.EntryPoint.invoke(EntryPoint.scala:46)
at cask.router.Decorator$.$anonfun$invoke$2(Decorators.scala:58)
at cask.endpoints.WebEndpoint.wrapFunction(WebEndpoints.scala:14)
at cask.endpoints.WebEndpoint.wrapFunction$(WebEndpoints.scala:12)
at cask.endpoints.get.wrapFunction(WebEndpoints.scala:31)
at cask.router.Decorator$.invoke(Decorators.scala:52)
at cask.main.Main$DefaultHandler.handleRequest(Main.scala:99)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
java.lang.NoClassDefFoundError: Could not initialize class play.api.libs.json.Writes$
at Main$.getWord(Main.scala:129)
at Main$.$anonfun$new$18(Main.scala:99)
at cask.router.Result$Success.map(Result.scala:21)
at cask.router.Result$Success.map(Result.scala:20)
at Main$.$anonfun$new$10(Main.scala:99)
at cask.router.EntryPoint.invoke(EntryPoint.scala:46)
at cask.router.Decorator$.$anonfun$invoke$2(Decorators.scala:58)
at cask.endpoints.WebEndpoint.wrapFunction(WebEndpoints.scala:14)
at cask.endpoints.WebEndpoint.wrapFunction$(WebEndpoints.scala:12)
at cask.endpoints.get.wrapFunction(WebEndpoints.scala:31)
at cask.router.Decorator$.invoke(Decorators.scala:52)
at cask.main.Main$DefaultHandler.handleRequest(Main.scala:99)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
No description
Pi, a future fluent jp speaker
GitHub
GitHub - LeonCelestino/Wordle-Game: A wordle game.
A wordle game. Contribute to LeonCelestino/Wordle-Game development by creating an account on GitHub.
Jochem
Jochem6mo ago
like I said in #chit-chat, this is not something you can fix or that you did wrong. You will have to find a different API to use
Pi, a future fluent jp speaker
that is it then? so sad the API died :(
Jochem
Jochem6mo ago
the CORS error is honestly probably caused by the same
Pi, a future fluent jp speaker
tbh I'm thinking in learning backend to make my own api for this game
Jochem
Jochem6mo ago
not a bad idea. This kind of API is an excellent beginner project for learning how to build APIs
Jochem
Jochem6mo ago
nice!
Pi, a future fluent jp speaker
Now I am having a trouble with deployment on vercel where do I ask? ;-; nvm I fixed it too
Jochem
Jochem6mo ago
#os-and-tools has a hosting tag
clevermissfox
clevermissfox6mo ago
You can also try to contact the api peeps(if they’re active) and let them know there’s a Cors error . I had to do that with a Stephan king api last month and they fixed it
glutonium
glutonium6mo ago
why do u want the api to return a grid?
Pi, a future fluent jp speaker
it is not the api that returns a grid
Want results from more Discord servers?
Add your server