Vercel responding with 405 for a api route

the api path is correct, i think vercel thinks of it as a static route
Solution:
logs:
Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
...
Jump to solution
13 Replies
teos
teos15mo ago
If using App Router, you're using a method (GET, POST, etc) that you did not declare or export in your route.ts
werz0xff
werz0xffOP15mo ago
nope im on pages i have tried a simple different route and its the same issue
werz0xff
werz0xffOP15mo ago
No description
teos
teos15mo ago
Can't reproduce it on my end. Make sure you delete your .next folder et restart the server... just in case
shiroyasha9
shiroyasha915mo ago
Do you have the src folder pattern or everything is in the root dir?
werz0xff
werz0xffOP15mo ago
im not using the src folder as well i even downgraded to the 12 version same issue still
shiroyasha9
shiroyasha915mo ago
can you upload some sample code in codesandbox so that we can take a look?
werz0xff
werz0xffOP15mo ago
also it does work fine locally the issue take place using vercel
werz0xff
werz0xffOP15mo ago
No description
werz0xff
werz0xffOP15mo ago
will do i've forget that vercel provide logs fixed it ty anyway
teos
teos15mo ago
Maybe you could add a very quick explanation of what was happening, and mark the question as resolved, so that it can help others in your case
werz0xff
werz0xffOP15mo ago
it is a pretty tricky issue tbh, basically the API routes that uses the prisma client get blockedon vercel if you don't generate the schema types, using "prisma generate"
Solution
werz0xff
werz0xff15mo ago
logs:
Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
Want results from more Discord servers?
Add your server