Fix Vercel deployment issues
- Update Node.js version from 18.x to 22.x for Neon compatibility - Fix TypeScript errors by properly typing error objects as Error - Resolve engine compatibility issues with @neondatabase/serverless and react-router - Add proper error type casting in all API endpoints - Fix FUNCTION_INVOCATION_FAILED crashes
This commit is contained in:
parent
4821d1a389
commit
33345a9f51
5 changed files with 6 additions and 6 deletions
|
|
@ -118,7 +118,7 @@ export default async function handler(req: NextRequest) {
|
|||
`;
|
||||
migratedCount++;
|
||||
} catch (error) {
|
||||
const errorMsg = `Error migrating card ${card.name}: ${error.message}`;
|
||||
const errorMsg = `Error migrating card ${card.name}: ${(error as Error).message}`;
|
||||
console.error(errorMsg);
|
||||
errors.push(errorMsg);
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ export default async function handler(req: NextRequest) {
|
|||
return new NextResponse(JSON.stringify({
|
||||
success: false,
|
||||
error: 'Migration failed',
|
||||
details: error.message
|
||||
details: (error as Error).message
|
||||
}), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export default async function handler(req: NextRequest) {
|
|||
console.error('API Error:', error)
|
||||
return new NextResponse(JSON.stringify({
|
||||
error: 'Internal server error',
|
||||
details: process.env.NODE_ENV === 'development' ? error.message : undefined
|
||||
details: process.env.NODE_ENV === 'development' ? (error as Error).message : undefined
|
||||
}), {
|
||||
status: 500,
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export default async function handler(req: NextRequest) {
|
|||
console.error('API Error:', error)
|
||||
return new NextResponse(JSON.stringify({
|
||||
error: 'Internal server error',
|
||||
details: process.env.NODE_ENV === 'development' ? error.message : undefined
|
||||
details: process.env.NODE_ENV === 'development' ? (error as Error).message : undefined
|
||||
}), {
|
||||
status: 500,
|
||||
headers: {
|
||||
|
|
|
|||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -38,7 +38,7 @@
|
|||
"tailwindcss": "^3.4.17"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
"node": "22.x"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"@neondatabase/serverless": "^1.0.1",
|
||||
|
|
|
|||
Loading…
Reference in a new issue