fix: add tldts as direct dependency for ESM compatibility#328
Merged
zereight merged 1 commit intozereight:mainfrom Feb 7, 2026
Merged
fix: add tldts as direct dependency for ESM compatibility#328zereight merged 1 commit intozereight:mainfrom
zereight merged 1 commit intozereight:mainfrom
Conversation
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+.
There was a problem hiding this comment.
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
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using
npxwith Node.js 22+, the package fails with:Cause
The dependency chain
fetch-cookie -> tough-cookie -> tldtscauses ESM module resolution issues whentldtsis only a transitive dependency.Solution
Add
tldtsas a direct dependency to ensure proper ESM resolution.Testing