🐛 fix: resolve Next.js build failure and failing tests#140
🐛 fix: resolve Next.js build failure and failing tests#140
Conversation
…e block The deployment failed in Coolify because the Next.js build step failed. The issue was caused by an orphaned `try...catch` block at the end of `Web/src/app/api/admin/run-migration/route.ts` that was left behind after the migration execution logic was refactored to use `prisma.$executeRawUnsafe`. Removing this trailing code block resolves the build error. Also fixed failing unit tests (healthConnect.test.ts, providers-ssrf.test.ts, scheduler.test.ts) that were negatively impacted by unrelated recent changes.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What
Fixed a critical Next.js build failure caused by trailing syntax errors in the database migration route handler, and resolved multiple pre-existing failing unit tests that would block CI.
💡 Why
Coolify deployments were failing during the
npm run buildphase becauseWeb/src/app/api/admin/run-migration/route.tscontained an orphanedtry { ... } catch (error) { ... }block outside of thePOSThandler function. This trailing code was a leftover from a previous migration approach usingchild_process.execSync('npx prisma migrate deploy')that was recently replaced with direct SQL execution.In addition to the syntax fix, running
npx jestrevealed several pre-existing test failures introduced by other recent changes. These failures were addressed to ensure the test suite passes reliably.✅ Verification
npm run buildlocally -> Succeeds without syntax errors.npx jest-> All tests now pass successfully.✨ Result
The application will now successfully build and deploy via Coolify. Test suite reliability is restored.
PR created automatically by Jules for task 10060729348615186711 started by @thies2005