Skip to content

fix: disable filename hashing to resolve type definition errors - #35

Merged
requesty-JohnCosta27 merged 1 commit into
requestyai:mainfrom
JorgeRosbel:fix/types-resolution
Jan 30, 2026
Merged

fix: disable filename hashing to resolve type definition errors#35
requesty-JohnCosta27 merged 1 commit into
requestyai:mainfrom
JorgeRosbel:fix/types-resolution

Conversation

@JorgeRosbel

@JorgeRosbel JorgeRosbel commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

fix: disable filename hashing in tsdown to fix type resolution

Description

The Problem
Currently, the build configuration uses the default behavior of tsdown, which generates hashed filenames for chunks (e.g., dist/index-F6sdE3i3.d.ts).

The Consequence
Standard TypeScript environments (specifically Node.js without bundlers) fail to resolve the type definitions because package.json points to a static entry point, but the actual files on disk have dynamic hashes. This leads to the error:

Could not find a declaration file for module... implicitly has an 'any' type.

The Fix

I explicitly added hash: false to tsdown.config.ts. This ensures the output files have stable filenames (e.g., index.d.ts), matching what the package entry points expect.

Verification

  1. Built locally (pnpm build).
  2. Verified that dist/ now contains clean .d.ts files without hashes.
  3. Linked to a consumer project via pnpm link and confirmed the TypeScript error is resolved.

Related Issue

Closes #34

High-level PR Summary

This PR fixes TypeScript type definition resolution errors by disabling filename hashing in the tsdown build configuration. Previously, the build generated files with dynamic hashes (like index-F6sdE3i3.d.ts) which prevented Node.js environments from resolving type definitions that referenced static filenames. By setting hash: false in two build configurations, the output files now have stable, predictable names that match the package entry points.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 tsdown.config.ts

Need help? Join our Discord

@recurseml recurseml Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 6a4f8ce..a60ab6e

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

tsdown.config.ts

@JorgeRosbel

Copy link
Copy Markdown
Contributor Author

Friendly ping @requesty-JohnCosta27

@requesty-JohnCosta27

Copy link
Copy Markdown
Contributor

Friendly ping @requesty-JohnCosta27

Sorry this must have skipped my inbox. Lovely thank you for the contribution!

@requesty-JohnCosta27
requesty-JohnCosta27 merged commit 218d3cb into requestyai:main Jan 30, 2026
5 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.

Bug: TypeScript declarations not found - Mismatched type definition filenames in dist

2 participants