-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next.js v15 support #225
Comments
Got this error when trying to run zsa-openapi
|
I have an error at build time:
This occurs when i install zsa-openapi |
I've got a similar error message to that, except it only occurs during build and I'm using createRouteHandlersForAction |
There is workaround for this:
I think ZSA is great! But two month without any commit? Or any fix for Next.js 15? It hurts right in my meow meow. |
It's not really a work-around. You are just suppressing build-time errors that will blow up in runtime. |
If you guys just coming here, i have better temporary fix for typed error instead suppress the nextjs typescript ignoreBuildErrors import { createRouteHandlers } from "zsa-openapi";
import { router } from "./_router/index.router";
// Define the expected type for Next.js route handlers for temporary fix
// See: https://github.com/IdoPesok/zsa/issues/225
type NextApiHandler = (request: Request) => Response | Promise<Response>;
// Create the route handlers
const handler = createRouteHandlers(router, {
shapeError: (error) => {
const code = JSON.parse(error.data).code;
return new Response(JSON.stringify({ code, message: error.message }), {
status: code,
});
},
});
export const GET = handler.GET as NextApiHandler;
export const POST = handler.POST as NextApiHandler;
export const PUT = handler.PUT as NextApiHandler;
export const DELETE = handler.DELETE as NextApiHandler;
export const PATCH = handler.PATCH as NextApiHandler; |
Please, add Next.js v15.0 support.
The text was updated successfully, but these errors were encountered: