Skip to content

Conversation

@andrea9293
Copy link
Owner

  • Use native fs.promises for directory reads and fs-extra for JSON helpers (readJSON/writeJSON/pathExists).
  • Prevents runtime TypeError when starting with MCP_INDEXING_ENABLED=true by avoiding shape mismatches between ESM/CJS imports.
  • Verified locally: rebuilt index, processed uploads, and search/context tools work without the previous error.

Closes #8

- Use native `fs.promises` for directory reads and `fs-extra` for JSON helpers (readJSON/writeJSON/pathExists). - Prevents runtime TypeError when starting with MCP_INDEXING_ENABLED=true by avoiding shape mismatches between ESM/CJS imports. - Verified locally: rebuilt index, processed uploads, and search/context tools work without the previous error. Closes #8
Copilot AI review requested due to automatic review settings September 5, 2025 12:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a runtime TypeError that occurs when starting the server with MCP_INDEXING_ENABLED=true due to ESM/CJS interoperability issues with the fs-extra library. The fix separates concerns by using native fs.promises for directory operations and fs-extra for JSON-specific utilities.

Key Changes

  • Replace fs-extra wildcard import with default import and separate fs.promises import
  • Use fsp.readdir() for directory reading instead of fs.readdir()
  • Continue using fs-extra for JSON operations (readJSON, writeJSON, pathExists)
@andrea9293 andrea9293 merged commit 19bc688 into main Sep 5, 2025
3 checks passed
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

🎉 This PR is included in version 1.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants