Nextjs api not found, but only sometimes
Unanswered
White-collared Seedeater posted this in #help-forum
White-collared SeedeaterOP
Hello. I got some code from a friend and it has a frontend with a button that calls the nextjs api "get-table"
The api is there and it sometimes work, but sometimes the console just throws
So my point is the code and the api works. But randomly? There are
And i cant figure out why it does that? Then after some refreshes it works, and then again randomly stops.
Any suggestions or help would be appreciated.
Thanks
const response = await axios.post("/api/get-table", { //code }
The api is there and it sometimes work, but sometimes the console just throws
POST http://localhost:3000/api/get-table 404 (Not Found)
So my point is the code and the api works. But randomly? There are
And i cant figure out why it does that? Then after some refreshes it works, and then again randomly stops.
Any suggestions or help would be appreciated.
Thanks
4 Replies
American Chinchilla
Can you show your route.ts if your using app router
Including the path for this route.ts
Barbary Lion
Does this happen on prod as well?
Could be an issue with dev mode
Could be an issue with dev mode
Can you show
/app/api/get-table/route.ts
?