Skip to content

Conversation

@codebycarson
Copy link
Collaborator

Fetch can be unavailable on some versions of node 18, this PR explicitly uses node-fetch for full backwards compatibility.

Fetch can be unavailable on some versions of node 18, this PR explicitly uses node-fetch for full backwards compatibility.
@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2025

🦋 Changeset detected

Latest commit: 83b3146

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sei-js/mcp-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codebycarson codebycarson requested review from besated and Copilot August 4, 2025 14:26

This comment was marked as outdated.

Copy link
Contributor

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 replaces the usage of the global fetch API with the explicit node-fetch package to ensure backwards compatibility with Node.js 18 versions that may not have the global fetch available.

  • Adds node-fetch and its type definitions as dependencies
  • Updates test mocking to use node-fetch instead of global fetch
  • Imports node-fetch in modules that make HTTP requests

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/mcp-server/package.json Adds node-fetch dependency and type definitions
packages/mcp-server/src/tests/core/tools.test.ts Updates test mocking from global fetch to node-fetch
packages/mcp-server/src/mintlify/search.ts Adds node-fetch import for HTTP requests
packages/mcp-server/src/docs/server.ts Adds node-fetch import for HTTP requests
.changeset/lovely-sloths-help.md Documents the change for version tracking
Comments suppressed due to low confidence (1)

packages/mcp-server/package.json:33

  • The node-fetch version ^2.7.0 uses CommonJS modules which may cause compatibility issues with ESM imports. Consider upgrading to node-fetch version 3.x which supports ESM, or ensure proper configuration for CommonJS compatibility.
		"node-fetch": "^2.7.0",

Copy link

@kamwithak kamwithak left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ade22d6) to head (83b3146).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #281   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           70        70           
  Lines          843       844    +1     
  Branches       139       139           
=========================================
+ Hits           843       844    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codebycarson codebycarson merged commit 1f25b0d into main Aug 4, 2025
3 checks passed
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.

4 participants