Vercel error when I try to deploy in the production #4053
              
                Unanswered
              
          
                  
                    
                      CristianM100
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| Please create an issue by following our issue template. Thanks | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
When I try to deploy in the production I get error type error: Route "app/api/orders/[orderId]/route.ts" has an invalid "GET" export:
`import { NextRequest, NextResponse } from "next/server";
import dbConnect from "@/lib/dbConnect";
import Order from "@/lib/models/Order";
export async function GET(req: NextRequest, { params }: { params: { orderId: string } }) {
try {
await dbConnect();
} catch (error) {
console.error("Error fetching order:", error);
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
}
}
this is the complete error when I run npm run buildType error: Type '{ tag: "GET"; param_position: "second"; param_type: { params: { orderId: string; }; }; }' does not satisfy the constraint 'ParamCheck'.The types of 'param_type.params' are incompatible between these types.
Type '{ orderId: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag]
47 | Diff<
48 | ParamCheck,
Beta Was this translation helpful? Give feedback.
All reactions