egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.46k stars 209 forks source link

Tsup generates hashes in names of `.d.ts` files #1129

Open bracesproul opened 1 month ago

bracesproul commented 1 month ago

How can I prevent tsup from generating these files with hashes at the end of the name? They only are .d.ts (generated when I set dts: true) and they cause this error in my monorepo when indirectly importing code from them (e.g I import from another file in a separate workspace of my monorepo, but that file imports from the file with the hash):

The inferred type of 'DEFAULT_TOOL_SYSTEM_PROMPT' cannot be named without a reference to '../../../../../node_modules/@langchain/core/dist/prompt-f7938666.js'. This is likely not portable. A type annotation is necessary.ts(2742)

If I manually delete the file it's referencing prompt-f7938666.d.ts then the error goes away.

Does anyone know how I can resolve this issue without adding type annotations?


Upvote & Fund

Fund with Polar

carlos-dubon commented 3 weeks ago

Same issue