Skip to content

fix: add tldts as direct dependency for ESM compatibility#328

Merged
zereight merged 1 commit intozereight:mainfrom
alfonsodg:fix/tldts-esm
Feb 7, 2026
Merged

fix: add tldts as direct dependency for ESM compatibility#328
zereight merged 1 commit intozereight:mainfrom
alfonsodg:fix/tldts-esm

Conversation

@alfonsodg
Copy link
Contributor

Problem

When using npx with Node.js 22+, the package fails with:

Error: Cannot find package 'tldts' imported from tough-cookie/dist/index.js

Cause

The dependency chain fetch-cookie -> tough-cookie -> tldts causes ESM module resolution issues when tldts is only a transitive dependency.

Solution

Add tldts as a direct dependency to ensure proper ESM resolution.

Testing

npx -y @zereight/mcp-gitlab --token=xxx --api-url=https://gitlab.example.com/api/v4

fetch-cookie -> tough-cookie -> tldts chain causes ESM resolution
errors when tldts is not a direct dependency. Adding it explicitly
fixes 'Cannot find package tldts' errors on Node.js 22+.
Copilot AI review requested due to automatic review settings January 20, 2026 19:18
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 an ESM module resolution issue that occurs when using the package with npx on Node.js 22+. The problem stems from tldts being only a transitive dependency through the chain fetch-cookie -> tough-cookie -> tldts, which causes module resolution failures in ESM contexts.

Changes:

  • Added tldts (^6.1.86) as a direct dependency to ensure proper ESM resolution
  • Reorganized dependencies in alphabetical order for better maintainability

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Added tldts as direct dependency and reorganized dependencies alphabetically
package-lock.json Updated lockfile to reflect new direct dependency on tldts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zereight zereight merged commit c695dd2 into zereight:main Feb 7, 2026
10 of 11 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.

2 participants