Skip to content

Fix/studyai embed duplicate import#3912

Open
PradeepTech-hub wants to merge 10 commits into
Premshaw23:masterfrom
PradeepTech-hub:fix/studyai-embed-duplicate-import
Open

Fix/studyai embed duplicate import#3912
PradeepTech-hub wants to merge 10 commits into
Premshaw23:masterfrom
PradeepTech-hub:fix/studyai-embed-duplicate-import

Conversation

@PradeepTech-hub

Copy link
Copy Markdown
Contributor

The StudyAI embed API route imported withErrorHandler and parseJSON twice from the same module. Duplicate imports caused the module to fail during build or evaluation, preventing the /api/StudyAI/embed endpoint from loading and serving requests.

This PR removes the duplicate imports while preserving the existing API behavior.

Description

This PR fixes a build/runtime issue in the StudyAI embed route by removing duplicate imports of withErrorHandler and parseJSON. The change ensures the module compiles successfully and the API endpoint loads correctly without modifying any request handling or business logic.

Related Issue

Closes #3911

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 Style / UI improvement
  • ♻️ Refactor (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or update
  • 🔧 Chore / Tooling / Config

Changes Made

  • Removed duplicate imports of withErrorHandler and parseJSON from app/api/StudyAI/embed/route.js.
  • Preserved the existing API implementation and functionality.
  • Ensured the StudyAI embed route compiles successfully without module evaluation errors.

Screenshots (if applicable)

N/A (Backend build/runtime fix)

Testing

  • I have tested these changes locally
  • I have added/updated tests where applicable
  • All existing tests pass

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • I have updated the documentation if needed
  • My changes generate no new warnings or errors

@PradeepTech-hub

Copy link
Copy Markdown
Contributor Author

Hi maintainers,

This PR only removes the duplicate imports in:

  • app/api/StudyAI/embed/route.js

I verified that my branch only modifies this source file (apart from an unintended package-lock.json change, which I can remove if needed).

The CI failures are being reported in multiple unrelated files, including:

  • app/api/attendance/route.js
  • app/attendance/page.jsx
  • app/calendar/page.js
  • app/offline/page.jsx
  • app/productivity/page.js
  • and several other files outside the scope of this PR.

Based on the CI logs, these errors appear to be unrelated to the duplicate-import fix in this PR. Please let me know if you'd like me to rebase or make any additional changes.

Thanks!
@Premshaw23

@PradeepTech-hub

PradeepTech-hub commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Yes, it is safe to merge.

Reason:

  • The fix is limited to removing duplicate imports in app/api/StudyAI/embed/route.js.
  • No application logic or API behavior was changed.
  • The current CI failures are in unrelated files that are outside the scope of this PR and are not modified by this branch.
  • This branch is ready to push for review.
    @Premshaw23

@PradeepTech-hub PradeepTech-hub force-pushed the fix/studyai-embed-duplicate-import branch from e331fc5 to a036414 Compare June 29, 2026 18:35
PradeepTech-hub and others added 2 commits June 30, 2026 00:19
Fix syntax errors in 11 files that caused Prettier to exit with code 2,
failing the CI format:check step for all PRs:

- app/api/attendance/route.js, app/attendance/page.jsx, app/offline/page.jsx:
  replace corrupted UTF-16 placeholder files with valid modules
- app/calendar/page.js, app/productivity/page.js: remove duplicate
  return statements with stray comment annotations
- components/BreathingExercise.js: fix invalid `window.if` syntax
- components/LearnovaChatbot.jsx: remove empty template expression
- components/ParentDashboard.js: remove duplicate return statements
- constants/quizData.js: remove extra closing brace
- next.config.mjs: remove trailing UTF-16 garbage bytes
- app/api/admin/parent-student-link/route.js: fix misplaced closing
  brackets and indentation in POST handler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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] Duplicate Import Causes Build Failure in StudyAI Embed Route

1 participant