Skip to content

fix(backend): resolve syntax errors in routes, batchController, and zkpVerifierService - #1373

Merged
spideydotjs merged 1 commit into
mainfrom
fix/backend-syntax-errors-1363
Oct 18, 2026
Merged

spideydotjs merged 1 commit into
mainfrom
fix/backend-syntax-errors-1363

Conversation

@spideydotjs

Copy link
Copy Markdown
Collaborator

📌 Overview

This PR resolves three critical syntax errors in the backend that prevented the server from starting and broke 18 Jest test suites:

  1. backend/routes/index.js: Removed redundant destructuring imports on lines 12-13 which redeclared protect, adminOnly, authorizeIoTSubmission, batchLimiter, and iotLimiter.
  2. backend/controllers/batchController.js: Removed stray .catch(...) line 807 appended after a try ... catch block in bulkUpdateBatchStatus.
  3. backend/services/zkpVerifierService.js: Fixed malformed path.join(__ environment || __dirname, ...) expression to standard path.join(__dirname, ...).

🔗 Related Issue

Closes #1363

🧪 Testing & Verification

  • node -c backend/routes/index.js (passed)
  • node -c backend/controllers/batchController.js (passed)
  • node -c backend/services/zkpVerifierService.js (passed)
  • npx jest tests/activityApi.test.js (passed 3/3)
  • npx jest tests/batchSearchRegex.test.js (passed 2/2)

…kpVerifierService

- Remove duplicate declarations of protect, adminOnly, authorizeIoTSubmission, batchLimiter, and iotLimiter in backend/routes/index.js
- Remove dangling .catch line after try-catch block in backend/controllers/batchController.js
- Correct path.join argument in backend/services/zkpVerifierService.js

Closes #1363
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
crop-chain Error Error Oct 18, 2026 5:34pm UTC

@github-actions

Copy link
Copy Markdown

🚀 Impressive! A new contribution to CropChain!

Thank you for your Pull Request. To help us merge this smoothly, please ensure:

  • Tests Pass: You have run npx hardhat test for contract changes.
  • Security: No .env files or private keys are committed.
  • UI Standards: Any frontend changes follow our 'Apple-level' design system.
  • Documentation: You've updated the README if you added new environment variables.

We will review your code soon. Happy building! 🌾✨

@spideydotjs
spideydotjs merged commit 987d518 into main Oct 18, 2026
12 of 22 checks passed
@spideydotjs
spideydotjs deleted the fix/backend-syntax-errors-1363 branch October 18, 2026 17:35

This branch had an error being deployed

1 failed deployment
Preview — c2dfef21 Deployed Oct 18, 2026 by vercel[bot]
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.

[BUG] Fatal syntax errors in backend routes, batchController, and zkpVerifierService crash server on startup

2 participants