Skip to content

🐛 fix: resolve Next.js build failure and failing tests#140

Closed
thies2005 wants to merge 1 commit intomasterfrom
fix-migration-route-build-error-10060729348615186711
Closed

🐛 fix: resolve Next.js build failure and failing tests#140
thies2005 wants to merge 1 commit intomasterfrom
fix-migration-route-build-error-10060729348615186711

Conversation

@thies2005
Copy link
Copy Markdown
Owner

🎯 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 build phase because Web/src/app/api/admin/run-migration/route.ts contained an orphaned try { ... } catch (error) { ... } block outside of the POST handler function. This trailing code was a leftover from a previous migration approach using child_process.execSync('npx prisma migrate deploy') that was recently replaced with direct SQL execution.

In addition to the syntax fix, running npx jest revealed several pre-existing test failures introduced by other recent changes. These failures were addressed to ensure the test suite passes reliably.

✅ Verification

  1. Run npm run build locally -> Succeeds without syntax errors.
  2. Run 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

…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.
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@thies2005 thies2005 closed this Mar 18, 2026
@thies2005 thies2005 deleted the fix-migration-route-build-error-10060729348615186711 branch March 18, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant