Next.js Discord

Discord Forum

app api router error on dev

Unanswered
Samyar posted this in #help-forum
Open in Discord
when i create a route in app router
the first time i call the api it dons't work and it gives me no explanation
however the database changes i mean when i call the api it just does not return anything but it will run

this behavior is only for the first call and it will only happen on dev

3 Replies

@Samyar do u use Vercel Postgres and Prisma? DB connection establishment time could be culprit as round trip btw dev and cloud are longer than that of prod. do u see any log in 'pnpm dev' console?
@tafutada777 <@644555171090923530> do u use Vercel Postgres and Prisma? DB connection establishment time could be culprit as round trip btw dev and cloud are longer than that of prod. do u see any log in 'pnpm dev' console?
I don't use vercel postgres I just use postgres locally running,

But yes I do use Prisma and postgres

And I thee thing is that Prisma works but the API returns nothing

Every time I make a change this will happen
if you want to know what is going on, you can use debugger to set breakpoints at api, then invoke it using cURL.