-
Notifications
You must be signed in to change notification settings - Fork 63
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
App/Route issue "Promise<unknown>" #241
Comments
I am facing same issue after update to next 14 |
Have you considered |
This fixed the error for me... Thanks @albertpeiro for this opening this isuse 👍 . const router = createEdgeRouter<NextRequest, NextResponse>();
router
.use((req, res, next) => AuthGuard(req, next))
.post((req, res, next) => {
return createProject(req, res);
});
export async function POST(req: NextRequest, res: NextResponse) {
return router.run(req, res) as Promise<NextResponse>;
}
I'll open a PR that updates the Readme for new users to save them from days of debugging 😃 |
I am also facing the same issue after upgrading to next 14. Thank you @albertpeiro for showing how to resolve this issue. |
This does not work as documented (in Typescript)
When I run production
npm run build
I get:to fix you'll have to
as Promise<any>
▲ Next.js 14.0.4
The text was updated successfully, but these errors were encountered: